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

  • SEARCH
  • Home
  • 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 8379873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:18:22+00:00 2026-06-09T16:18:22+00:00

I’m relatively new to PHP. Started learning PHP, but then come across cakePHP, which

  • 0

I’m relatively new to PHP. Started learning PHP, but then come across cakePHP, which is suppose to speed up development time.

After reading the documentation and blog tutorial I still don’t understand the naming convention. I guess I won’t know until I start to do some examples, but to get me started can someone please explain to me how cakePHP associate database tables to the controller/model layer?

The below code is an abstract from the tutorial. It is a controller method that passes the post id to the view layer. The database table is called “posts”. $this->Post refers to the model class of Post, which correlates to the plural form of posts in the database.

public function view($id = null) {
  $this->Post->id = $id;
  $this->set('post', $this->Post->read());
}

OK I get that. Then, in the documentation it refers to the following correlation:

ReallyBigPerson and really_big_people

So it seems like the correlation actually follows the rule in English semantics. Does this mean that cakePHP has a list of singular and plural words hidden somewhere that it works from? For example can I use the below correlation without breaking the code?

This and these or Man and men or Foot and feet or Moose and moose or Goose and geese

Furthermore, if I have both singular and plural form of tables in my database, will it break the code, or will it just associate to the plural-formed table?

Just find it baffling… Why couldn’t they just match the naming convention like for like with prefixes?

  • 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-06-09T16:18:23+00:00Added an answer on June 9, 2026 at 4:18 pm

    Inflector

    CakePHP uses its Inflector class to determine the plurals of things.

    Since the naming conventions dictate that model names are singular and tables names are pluralised, it uses the inflector to apply English semantics / rules to determine the plural.

    If you need some help understanding the output of the Inflector, you can use the CakePHP inflector website.

    Pluralisation Examples

    Model name: Post
    Table name: posts
    
    Model name: User
    Table name: users
    
    Model name: Sheep
    Table name: sheep
    
    Model name: News
    Table name: news
    
    Model name: Radius
    Table name: radii
    

    Check the Inflector site to be sure.

    Non-standard Table names

    While CakePHP offers a standard rule set for naming and conventions, none of it is set in stone. If you want to change the name of the table used for a particular model, simply specify the table name in the model:

    class Thing extends AppModel {
        public $useTable = 'somethings';
    }
    

    Or, if you want a model that does not use a table:

    class Post extends AppModel {
        public $useTable = null;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
this is what i have right now Drawing an RSS feed into the php,
Specifically, suppose I start with the string string =hello \'i am \' me And
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported

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.