Yii Framework Forum: Call an action inside an action/view - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Call an action inside an action/view Rate Topic: -----

#1 User is offline   soissons 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 12-April 12

Posted 08 June 2012 - 09:02 PM

Hi,

I have a view like this: (this is from a view called from an action, and not from a layout page)
<container>
     <div id="menu">
         <!-- some content -->
     </div>
     <div id="content">
     </div>
</container>


And I would like to call an action and renderPartial its view inside #content.

I've added this into #content and it displayed the wanted view, but I would also like to call his action method.
$this->renderPartial('myView');


The initial idea was to do this with Ajax but it interferes with a wysiwyg that I'm using.

Any suggestions please.
0

#2 User is offline   rookie84 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 114
  • Joined: 16-November 11

Posted 10 June 2012 - 08:47 PM

For example you have an action inside the same controller you are using:

public function actionFoo()
{

}


You can call it inside the view as:

$this->actionFoo();

0

#3 User is offline   rookie84 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 114
  • Joined: 16-November 11

Posted 10 June 2012 - 08:51 PM

I would suggest using a widget for your purpose though.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users