E
E
EVOSandru62015-01-22 11:51:07
Yii
EVOSandru6, 2015-01-22 11:51:07

How to make renderPartial through clip in controller in Yii?

Good afternoon,
the problem is this, I have a create.php file in the views/review/ folder . For this controller, I generate a specific three-column template and in the third column I put a clip from the controller that hooks create.php , which in turn does renderPartial to _form.php Tried to connect to create.php like this

$this->beginClip('reviewForm');
     $this->renderPartial('application.views.review.create');
$this->endClip();

, but got this error:
Fatal error: Call to a member function getErrors() on a non-object in X:\home\visakaz\www\framework\web\helpers\CHtml.php on line 2002
How to connect correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vyachin, 2015-04-08
@EVOSandru6

When you render the create template from a controller method, you are passing in a model. Something like this,
but here you don’t transfer
i think it should be something like this

$this->renderPartial('application.views.review.create', ['model'=>$model]);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question