CakePHP – Quick Tips for Non-English Speaker

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.
Leave a Comment