2009年4月27日星期一

整合1.1 与 1.2

1. 配置 app/config/core.php
[php]
Configure::write('debug', 2);
[/php]

2. 在1.2中,原来在HTML helper中的一些移入到Form helper

3. 1.1 中,uses, vendor, 以及laod* 系列的函数如loadModel,在1.2中,都用App::import来取代。第三方的库或文件也不再需要按照cake的命名规则或者一定需要放在vendors的文件夹中
[php]
App::import('vendor', 'aUniqueIdentifier',
array('file' => 'path/relative/to/vendor/file.php')
);
[/php]
4. generateList()被find('list')替代, 也可以在app/app_mode.php 这样简化:
[php]
function getlist ($cond=null,$order=null,$limit=null,$key=null,$val=null) {
return $this->find("list",array(
'conditions' => $cond,
'order' => $order,
'limit' => $limit,
'fields' => array(str_replace('{n}.','',$key), str_replace('{n}.','',$val))
));
}
[/php]

没有评论 :

发表评论