摘要: 1、首先要定义下app/web_root/为虚拟主机的根目录2、如果不是也会请求到那个文件,所以web_root就是入口文件入口文件定义了全局变量,定义了很多路径相关的信息,比如web_rootappcss这里实在是太多了3、加载三个文件require CAKE . 'basics.php';require CAKE . 'Core' . DS . 'App.php';require CAKE . 'Error' . DS . 'exceptions.php';然后定义了home_urlFULL_BASE_URLa 阅读全文
posted @ 2013-02-28 18:20 linksgo2011 阅读(337) 评论(0) 推荐(0)
摘要: 使用的是一种叫做 // App Controller Code.public function beforeFilter() { $locale = Configure::read('Config.language'); if ($locale && file_exists(VIEWS . $locale . DS . $this->viewPath)) { // e.g. use /app/View/fre/Pages/tos.ctp instead of /app/View/Pages/tos.ctp $this->viewPath = $loc 阅读全文
posted @ 2013-02-28 16:01 linksgo2011 阅读(207) 评论(0) 推荐(0)
摘要: class Post extends AppModel { public function newest() { $result = Cache::read('newest_posts', 'longterm'); //去拿缓存数据 if (!$result) { //如果缓存没有数据,就从数据库中去那数据 $result = $this->find('all', array('order' => 'Post.updated DESC', 'limit' => 10)); //获取 阅读全文
posted @ 2013-02-28 14:49 linksgo2011 阅读(201) 评论(0) 推荐(0)