Suppose I have protected/controllers/PostController/actionCreate()
How can I re-use this same action (and its view) in protected/modules/admin/controllers/PostController/actionCreate()
I do not want to redirect the user - I just don’t want to have to replicate the same code in both actions.
Create a CAction class?
class PostCreate extends CAction
public function run()
Then reference it in your controller.
public function actions()
'create' => 'path here to action class file'
Keith - using forward() also brings in the layout file, which I do not want.
alex-w - do I need to create separate class files for each action?
No, You can still have actions in the controller.
Creating an action class just allows you to use it from other controllers.