Welcome to the Cookbook

loading...

3.5.3 The Pages Controller

Er is geen nog vertaling vertaling voor deze rubriek. Help ons en vertaal dit.. Meer informatie over vertalingen

CakePHP core ships with a default controller called the Pages Controller (cake/libs/controller/pages_controller.php). The home page you see after installation is generated using this controller. It is generally used to serve static pages. Eg. If you make a view file app/views/pages/about_us.ctp you can access it using url http://example.com/pages/about_us

When you "bake" an app using CakePHP's console utility the pages controller is copied to your app/controllers/ folder and you can modify it to your needs if required. Or you could just copy the pages_controller.php from core to your app.

Do not directly modify ANY file under the cake folder to avoid issues when updating the core in future