How to code the illusion of choice in cakephp
-
Recent Posts
-
Recent Comments
Categories
How to code the illusion of choice in cakephp
Using postCondition to simplify your search or filtering feature.
I found out that on cakephp 1.2 RC3 you must use the new $Model->find() style or the query will break.
1
2
3
4
5
6
7
8
9
10
11
//in the controller use this…
$this->Post->find(’first’, $params);
//instead of the ‘old’ style…
$this->Post->find($conditions);
//so that in the model, you can do something like this…
function beforeFind($queryData) {
$queryData[’conditions’]["`Post`.`post_type`"] = "personal";
[...]
Saya akan bagi talk mengenai cakephp di event veryimportantprogrammer.com hari ini. Ini akan menumpu kepada cakephp secara am dengan harapan pendengar dapat melihat macam mana membina aplikasi cakephp.
Kebetulan terjumpa coding lama yang boleh saya guna untuk demo.
Files dan slides akan saya letakkan di sini selepas talk. Coding lama tu perlu kepada sedikit comments untuk memudahkan [...]
contoh menggunakan find mengikut cakephp 1.2