Misunderstanding of CakePHP beginners or not cake users
I and @hiromi2424 picked up some misunderstandings of CakePHP, especially cake beginners/not cake users.
Need no SQL knowledge, because Cake model makes SQL statements.
SQL knowledge is so important. We have to understand SQL statements which CakePHP made. It’s good for performance improvement, debug and avoiding security problems.
Everybody can learn and develop fast, good for PHP noobs
It’s better to understand OOP and pure PHP before using Cake.
Need a patch to use external libraries
We can use any libraries. Set library files in vendors directory and call App::import(’Vendor’,'LibraryName’)
Slower so much than pure php
It’s true only to compare with “Hello world” scripts, but production code is more complex. Production code are using many functions and objects, fetching DB records.
In production code, cake applications are slower than pure php one, but not slower so much.
APC(OP code caching) is great solution of performance imporvement.
Can make similar code whoever coding.
It depends on skill and knowledge of MVC.
Don’t have to care security problems when use SecurityComponent
SecurityComponent detects and protects from CSRF and alteration of post fields.
http://book.cakephp.org/#!/view/1296/Security-Component
We have to care more security problems, XSS, SQL Injection, ObjectInjection and so on.
DB is mandatory
Set “false” to Model::useTable property.
CakePHP FromHelper decides html input type from DB schema, so it’s better to set input type option of FormHelper::input() without DB.
FormHelper/HtmlHelper is mandatory
You can write view files with pure html tags ![]()
It’s easy to make form screen using helpers, but sometimes the html tags CakePHP made can’t fit your html/css.
If helpers is annoying you so much, make new helper extending cake helper or set tags.php or get rid of cake helpers(SecurityComponent needs FromHelper, make CSRF protection by yourself).
Can’t change bake templates
http://book.cakephp.org/#!/view/1526/Modify-default-HTML-produced-by-baked-templates
must follow singular/plural convention
There are some ways to avoid convention. Ex. can use any table name with Model::table property.
We can define our inflection rules using Inflector::rules()
http://book.cakephp.org/view/953/Inflections
http://api.cakephp.org/class/inflector#method-Inflectorrules




May 20th, 2011 at 11:25 am
when i have one of this syndrome, i know, i am beginner. tq for the info
May 20th, 2011 at 12:21 pm
yeah dude, learning cakephp is no way near easy with without it “It’s better to understand OOP and pure PHP before using Cake.”
December 19th, 2011 at 1:16 am
Fluffy