How to render views from class-based actions?

Hello,

I tried to move my actions in separate classes as described here.

The question is:

How do I use render from the new run() method inside my xxxAction which extends CAction?

I cannot use $this->render() since this method is part of CController.

Thank you for your help.

I have found the answer. One needs put:




 $this->getController()->render('index_1', array(

            'dataProvider' => $dataProvider,

        ));



instead of




 $this->render('index_1', array(

            'dataProvider' => $dataProvider,

        ));



in the run() method of the new xxxAction class.

Thanks

This subject offered by you is very constructive for correct planning.

I’m still learning from this blog, but I’m trying to reach my goals. I absolutely love reading everything that is written on your website.Keep the posts coming. I loved it!

Thank you for your good post,I really liked reading it