I
I
Ivan Ignatiev2015-10-28 21:36:28
Yii
Ivan Ignatiev, 2015-10-28 21:36:28

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);
   }

Where getPagesByParentId returns an instance of CActiveDataProvider:
$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,
     )
));

And, of course, layouts/news:
<?php
$this->widget('zii.widgets.CListView', array(
    'dataProvider'=>$news,
    'itemView'=>'_new',
    'ajaxUpdate'=>true,
    'template'=>"{items}\n{pager}"
));
?>

As a result, I get a broken page consisting of a piece of layout with placeholders like <###dynamic-1###> in place of dynamicRenders. All logs are included and fall on the mail, but there is nothing in them except 404x from the lost icon. Such is the sudden death.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2015-10-28
@0x9d8e

Server logs, as I understand it, and that in the $app/runtime/logs/app.log logs,
errors are usually written there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question