By default, CakePHP responds to a request for the root of your site (i.e. http://www.example.com) using its PagesController, rendering a view called "home". Instead, we'll replace this with our PostsController by creating a routing rule.
In my blog application I want to acced directly to the post view so I have to change the default route :
Now, we can access to our blog just with the address : http://127.0.0.1/uscms
In my blog application I want to acced directly to the post view so I have to change the default route :
Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));In order to be the post controller and the action has to be display the index page so, the line now it's gonna be like this :
Router::connect('/', array('controller' => 'posts', 'action' => 'display', 'index'));
Now, we can access to our blog just with the address : http://127.0.0.1/uscms
No comments:
Post a Comment