CakePHP – Quick Tips for Non-English Speaker

cakephp_logo

CakePHP ; when to use to use SINGULAR or PLURAL – ‘the S’ trauma for non-English speaker.

Now note this :: (not 100% perfect. Just my quick sketch and will be reviewed constantly)

database can be flexible – with or without S
table – table name must be in plural – (with S)
field – shouldn’t be with S , and must be in lowercase

/app/models .

most things in models DONT use S .

mytable.php – script sample ;

<?
class Mytable extends AppModel
{
var $name = “Mytable”;
var $uses = “mytables” // table name
}
?>

besides the S trauma , check also the UPPERCASE use infront of table name , eg : Mytable

/app/controllers

most things in controllers USE S .

mytables_controller.php ,sample script

<?
class MytablesController extends AppController
{
var $name = ‘Mytables’;
var $scaffold; // use scaffold to auto generate page views
}
?>

This is the basic script how you can crash into CAKEPHP using ‘scaffolding’.

Point your browser to http://localhost/cake/mytables/ to add/view or delete your data

Hope this help.

Advertisement



    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Connecting to %s



Follow

Get every new post delivered to your Inbox.