当CListView在页面中时,Foundation()是未定义的


Foundation() is undefined when CListView is in the page

我有一个Yii布局,称为Main,它加载所有的CSS和JavaScript,正确排序。

我有两个视图,一个是纯HTML,另一个是这样的:

    <?php
        $dataProvider=new CActiveDataProvider('agenda');
        $dataProvider->pagination->pageSize=5;
        $this->widget('zii.widgets.CListView', array(
            'dataProvider'=>$dataProvider,
            'enablePagination'=>true,
            'itemView'=>'_agenda',   // refers to the partial view named '_agenda'
            'pager' => array(
                'class' => 'CLinkPager',
                'header' => false,
                'htmlOptions' => array('class' => 'pager'),
                'maxButtonCount' => '10',
                'cssFile'=>'css/my.css',
            ),
        ));
    ?>

我的问题:

第二个抛出这个异常Undefined is not a function,并瞄准代码中$(document).foundation();的行。

是它抛出的唯一错误,而且两者都导入了相同的javascript和CSS。

它们不兼容?

解决了,我只是与基金会的jQuery和Yii的jQuery有冲突。

解决方案就是在顶部使用这个:

<?php Yii::app()->clientScript->registerCoreScript('jquery'); ?>

删除其他jQuery并将foundation.min.js移动到底部