Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5850451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T13:08:33+00:00 2026-05-22T13:08:33+00:00

I am complete beginner to CakePHP but I am a bit knowledgeable in ROR.

  • 0

I am complete beginner to CakePHP but I am a bit knowledgeable in ROR.

Can somebody pls give me some simple examples on how to make use of pages_controller.php? I want to create static pages such as Home, About, and etc but I don’t know how and where to start. I tried something like creating a about.ctp in the views and creating about_controller.php (this is how being done in Ruby on Rails) but I just got some errors.

I concluded that all of the static pages will only use 1 controller which is pages_controller.php but I dont know how.

I tried reading the article found on this link:

http://book.cakephp.org/view/958/The-Pages-Controller

but it doesn’t give me anything that will help me learn how to use it.

This is what I got from the page:

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.

Can somebody pls show me or explain to me how??? I am a total beginner pls help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T13:08:33+00:00Added an answer on May 22, 2026 at 1:08 pm

    It’s pretty self explanatory.

    Create a file in your APP/views/pages/ folder – e.g about_us.ctp

    Type in your content. No layout; just the text, tables/images/etc

    <h3>About my site</h3>
    <p>bla bla la</p>
    <?php echo $this->Html->image('my_img.jpg'); ?>
    

    Save.

    Go to http://www.site.com/pages/about_us – your page is served.

    Pages is the controller to serve static pages. you don’t need an about_controller, unless you need something more than just a static page.

    You can change how the link looks by using routing.

    You can set variables for use in your template as well:

    about_us.ctp

    <?php
    $this->set('title_for_layout', 'My about page');
    $this->set('active_link', 'about'); 
    ?>
    <h1>My page!</h1>
    etc
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a rather broad question, but I'm a beginner-intermediate programmer that has just
I am new to jdbc.I dont know anything about jdbc.I want complete and detailed
I am a beginner. function show() { result = $.ajax({ url: Index.aspx?cmd=fill, async: false,
i am a beginner function PopupUserRegist() { result = $.ajax({ url: Default.aspx?cmd=Setting, async: false
I'm a C# beginner facing problems regarding sending an image from a client to
I want to work on SIP and Android. I am supposed to make it
//complete start ::= template. //template template ::= template_elements. template ::= template template_elements. template ::=
does anyone have any json tutorials that are easy enough to understand for a
I'm currently using Yahoo Pipes which provides me with a JSON file from an
Almost 6 months ago, I asked a question on stackoverflow Software to help in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.