無理やりですが。
対象のテーブルはServersとします。
[cakeのインストール先]/app/views/smarty.phpの69行目あたりにtemplate_dirの定義を追加。
simpletestからダウンロードして、[cakeのインストール先]/app/vendors/simpletestに設置。
$ cd [cakeのインストール先]/app/vendors $ tar zxpf simpletest_1.0.1.tar.gz
http://[cakeをインストール]したサーバ]/test.php
templateの場所を
app/views/pages/smarty/display.tplからapp/views/pages/display.tplに変更する。
app/config/core.phpの最後に
Configure::write('Smarty.subDir', '');
Configure::write('Smarty.layoutPath', '');
を追加。
app/controllers/pages_controller.php
class PagesController extends AppController{
var $name = 'Pages';
var $view = 'Smarty';
function display(){
}
function admin_index(){
echo "admin_index";
}
}
app/models/page.php
class Page extends AppModel {
var $name = 'Page';
var $useTable = false;
}
app/views/pages/smarty/display.tpl
this is display.tpl
Smarty Downloadからダウンロード。
ここから最新版のダウンロード。
$ tar zxpf cake_1.2.5.tar.gz # 展開 $ cd cake_1.2.5 $ chown -R apache app/tmp # apacheが書き込みできるように
各クラスのパスを追加したい場合はapp/config/bootstrap.phpに追記。
$viewPaths = array(
ROOT.DS.APP_DIR.DS.'views'.DS,
ROOT.DS.APP_DIR.DS.'views'.DS.'admin'.DS,
);
$controllerPaths = array(
ROOT.DS.APP_DIR.DS.'controllers'.DS,
ROOT.DS.APP_DIR.DS.'controllers'.DS.'admin'.DS,
);
データベースの設定。
Configure::write('Routing.admin', 'admin');
Configure::write('debug', 2);
Configure::write('App.encoding', 'UTF-8');
Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');