我对全日历有问题,因为在按钮上一页,下一页,标题和事件中不显示特殊字符(ę,±,ń)。这是在zend视图phtml中实现的。到处都有特殊字符(菜单,新闻等)。我已经设置了字符集utf-8。为什么这不起作用?我使用lang包-抛光至全日历。请帮助我!
查看脚本:
<?php $this->headLink()->appendStylesheet('/fullcalendar-2.1.1/fullcalendar.css'); ?>
<?php $this->headLink()->appendStylesheet('/fullcalendar-2.1.1/fullcalendar.print.css', 'print'); ?>
<?php $this->headScript()->appendFile('/fullcalendar-2.1.1/lib/moment.min.js'); ?>
<?php $this->headScript()->appendFile('/fullcalendar-2.1.1/fullcalendar.min.js'); ?>
<?php $this->headScript()->appendFile('/js/lang.all.js'); ?>
<?php $this->headScript()->captureStart(); ?>
var calendar_elements = [
<?php foreach($this->events as $event): ?>
{
title: '"<?php echo str_replace('\'','\\\'',$event['name']); ?>"',
start: '<?php echo $event['date']; ?>',
editable: false,
},
<?php endforeach; ?>
];
<?php $this->headScript()->captureEnd(); ?>
<div class="row">
<div class="col-sm-12"><div id='calendar'></div></div>
</div>
<script>
$(document).ready(function() {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
lang: 'pl',
editable: true,
eventBackgroundColor: 'red',
eventLimit: true, // allow "more" link when too many events
events: calendar_elements,
});
});
</script>
İ非常了解您。实际上,这是完整日历的问题,它不能将代码呈现为html。使用事件呈现功能,我们可以解决此问题。
eventRender: function(event,element){
element.find('.fc-title').html(event.title);
},
在您的模板中设置元标记。
<meta charset='utf-8' />
对于全日历的更高版本
eventRender: function(info){
$(info.el).find('.fc-title').html(info.event.title);
},