Reputation: 2910
As title, how can I change default view without placing home.ctp in apps/views/pages/ folder?
lets say, I want the default home page to show /views/other/index.ctp .
Where should I change the coding? which files does it involved? Thank you.
Upvotes: 8
Views: 18076
Reputation: 9964
Create an OtherController
:
// app/controllers/other_controller.php
class OtherController extends AppController {
public function index() {
// do something
}
}
and point the root route in app/config/routes.php
to it:
Router::connect('/', array('controller' => 'other', 'action' => 'index'));
Upvotes: 19