I have a "view" page in Yii.
It is cached with page cache.
Now, I want to insert some dynamic content:
$this->renderDynamic('renderPartial','view_name');
The rendered view looks like this:
<?php some code ?>
<div>...some html...</div>
The code works fine, but there is this error:
<###dynamic-0###>
So I understand the html is being echoed instead of returned.
I try to pass the return=true to the renderPartial function.
What is the right syntax to do it?
More info: http://www.yiiframework.com/doc/api/1.1/CController#renderDynamic-detail
Cached view file:
$this->renderDynamic('dynamicTest');
Controller file (callback function):
public function dynamicTest()
{
return $this->renderPartial('dynamicTest', null, true);
}
Dynamic view file:
echo 'dynamicTest_' . time();
I think that You forgot to add return in callback function (step 2).
I try to pass the return=true to the renderPartial function. What is the right syntax to do it?
third param of renderPartial is needed flag
$this->renderDynamic('renderPartial','view_name', null, true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With