Answer the question
In order to leave comments, you need to log in
Yii 1: Why does dynamicRender die (without logs) on CListView?
With the first Yii, one might say, did not work. I ran into this problem and I don't understand what's going on.
It is necessary to display a dynamic block with news in a static, fully cached page.
In the layout I write:
In the controller:$this->renderDynamic('renderNews');
public function renderNews() {
return $this->renderPartial('//layouts/news', array(
'news'=>$this->getPagesByParentId(185, 3)// >:(
), true);
}
$criteria = new CDbCriteria;
$criteria->alias = 'page';
$criteria->condition = 'parent_id = :parentId & status = 1';
$criteria->distinct = true;
$criteria->order = 'create_time DESC, alias ASC';
$criteria->params = array(':parentId'=>$parentId);
return new CActiveDataProvider($this->loadModelById($parentId), array(
'criteria' => $criteria,
'pagination' => array(
'pageSize' => $limit,
)
));
<?php
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$news,
'itemView'=>'_new',
'ajaxUpdate'=>true,
'template'=>"{items}\n{pager}"
));
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question