Search code examples
phpyiirenderpartial

Call another controller action using renderPartial


i have problem in calling action from different controller using renderPartial.

I have one controller 'SiteController'. In which i call action from another controller 'AbcController'.

$this->renderPartial('Abc/_jobList',array('value'=>$value));

But i get following error

SiteController cannot find the requested view "Abc/_jobList".

Even i use

$this->renderPartial('//Abc/_jobList',array('value'=>$value)); 

and i get same error.

How can i solve it??


Solution

  • I think you are trying to access different controller's view.

    For that you can access that by

    $this->renderPartial('application.views.abc._jobList',array('value'=>$value));
    

    But if you want to call another controller action then You have to redirect to that action from your current action using

    $this->redirect("controllername/functionname")