新灵空间

I will go wherever god leads me to!

CakePHP -day01

shpeacelover posted @ 2014年4月29日 17:38 in PHP , 410 阅读

1. If a timezone error is displayed, just add the following line to the script ,  "lib/Cake/Cache/CacheEngine.php":

date_default_timezone_set('Asia/Shanghai');

2. At first I can not connect to the database, just change the line from 'host' => 'localhost' to 'host' => '127.0.0.1'.

3. The names of database tables as well as controllers are lowercase and in plural form.

4. The name of the class will always need to match up to the file name of the controller and be camel case1 with the word Controller.

5. Models are named like controllers except they represent interacting with one instance of the database table at a time, so they will take on a singular, not plural, form.

6. Helpers provide functionality that is used across multiple views.

 

blog comments powered by Disqus