qwerty
(qwerty)
March 6, 2009, 6:07pm
1
Hi,
in my UserController if I have error in validation I create 2 varialbes with rendered partial:
$error=$this->renderPartial('create',array('user'=>$user),true,true);
$content=$this->renderPartial('_error',array('error'=>$error),true,true);
How can I join $content with view from SiteController and then together show in layout?
qiang
(Qiang Xue)
March 6, 2009, 6:12pm
2
renderText()? I'm not sure if I understand you correctly.
qwerty
(qwerty)
March 6, 2009, 6:52pm
3
thanx, it works but I have another problem.
$error=$this->renderPartial('create',array('user'=>$user),true,true);
$content=$this->renderPartial('_error',array('error'=>$error),true,true);
$content.=$this->renderPartial('/site/index',null,true,true);
$this->renderText($content);
The code above return exception:
Quote
UserController cannot find the requested view "/site/index".
Note that the UserController is from a module and index is from view SiteCotroller.
qiang
(Qiang Xue)
March 6, 2009, 7:02pm
4
In order to access views in an application, a controller in a module must use path alias. In your case, the view name should be 'application.views.site.index'.