Also near the end, I'll tell about you about how to give your page a custom title using
$this->pageTitle = 'This is your page title';
To create About us page (Static Page Creation Example)
Just create a new file.
Write some text. You can use ANY HTML as well.
Save it as 'about_us.ctp' under 'app/views/pages' folder.
You are done.
You can access the page as:
Note the word 'pages'. It is a CakePHP core controller. It displays any_name.ctp file saved under 'app/views/pages' folder. I'll talk a lot about controller later. For the time being, it is just more than enough to know that you can create a new file, write some text, save it with a name under that path, and point your browser to:
You should be able to view your new page.
1. The pages MUST have a file extension of '.ctp'. (FILENAME should be underscored ('_'), like, my_file_name, to obey Cake convention.
2. Static pages MUST be saved under 'app/views/pages' folder.
3. To access the page you MUST use: http://caketest.local/pages/my_page_name
As such, you can change ANY or ALL of the above three settings in Cake. But it is better to accept default settings for most of the time - at least when we have just stepped into a new DOMAIN.
Page Title for your Static Page
Now to give this new page a custom page title copy-paste following code anywhere in 'about_us.ctp' file:
$this->pageTitle = 'Replace this with Your Own Title Here';
?>I placed it at the top of my 'about_us.ctp' file for natural reason.
And here is my NEW Static About us page:
You can create any static page like Privacy Policies Page, Terms of Service page etc. Just FOLLOW the conventions and Cake does the rest for you.
May I move on to explore some inner details of CakePHP, like creating LINKS etc.?