Posts Tagged with render

Displaying 1-3 of 3 results.
Resolved: Yii2 basic render path problem in modules
posted by admin on March 1, 2017
In my layouts I have code with render

. . .
<div class="wrap">
<?= $this->render('/partials/menu'); ?>
. . .

And when I run my Module I have got error

The view file does not exist: The view file does not exist: /var/www/html/vktracker2/modules/admin/views/partials/menu.php

I tried to fix by

<?= $this->render(dirname(_FILE__) . '/partials/menu'); ?>

But it didn't helpRead more
Resolved: Yii get renderpartial and store in value
posted by admin on May 22, 2016
I want to store renderpartial, and dont want to echo

<?php $this->renderPartial($view, $data); ?>

It echo content automatically.
I want to store it like

$value = "my value";
$value .= $this->renderPartial($view, $data);
Read more
Resolved: Yii CActiveDataProvider CListView pagination error
posted by admin on April 15, 2016
In Controller:

$dataProviderComments = new CActiveDataProvider('Comments',
'criteria' => array(
'order' => 'id DESC',
'pagination' => array(
'pageSize' => 10,
'pageVar'=> 'page'

$this->render('/media/view', array('comments'=>$dataProviderComments));

In View:

<?php $this->widget('zii.widgets.CListView', array(
)); ?>

When my comments less than 10, all is right, but when will be pagination, start from 11, I see this error

Fatal error: Call to a member function getId() on null in C:\xampp\htdocs\\framework\web\CController.php on line 962
Read more