2013年10月9日 星期三

[CakePHP] [Tutorial] Retrieve Fields & Virtual Fields

find()
http://book.cakephp.org/2.0/en/models/retrieving-your-data.html

fieldname - virtual field setup:
http://book.cakephp.org/2.0/en/models/virtual-fields.html

find('list') return array( key: id ; value: displayField )
displayField setup:
http://book.cakephp.org/2.0/en/models/model-attributes.html#model-displayfield

set primary key of table which is not conventionally named as 'id':
http://stackoverflow.com/questions/680078/how-does-cakephp-handle-habtm-tables-with-without-an-id-field




http://book.cakephp.org/2.0/en/models/model-attributes.html

沒有留言:

張貼留言

[夕陽感言] 系統的千瘡百孔

凡事都有兩面,有好處,自然有壞處;有得,自有失;沒有完美,總有它的限制。 沒有一個程式可以解決所有的問題,沒有一個系統沒有漏洞。它能到達「成熟」的階段,但它永不會完美。之後就是隨著年日總有「老化」的一天,或是世界進步了,或是已經maintain不到了……科技的日新月異,隨著pro...