Cakephp - Using the same view for multiple controler functions

less than 1 minute read

Question: I have a Cakephp project the controller has several different methods.

function Index() function IndexAuthor()

And I want to use the same ‘view’ (or template, Index.ctp) for both of the methods of the control.

Answer:

You’re looking for Controller::render(). function IndexAuthor() { $this->autoRender = false ; $this->render('/stories/admin_index'); }

Source: http://stackoverflow.com/questions/1753585/cakephp-same-view-for-multiple-functions

Leave a comment