Subscribe to RSS Feed

Subscribe to Comments Feed

Subscribe to Atom Feed

tech

技術的なことのメモ
  • blog
  • sitemap
  • 紹介

paginatorのSmarty化

by outsider タグ: cakephp, php
07 08 2009

無理やりですが。
対象のテーブルはServersとします。

  • smarty.phpの修正
  • [cakeのインストール先]/app/views/smarty.phpの69行目あたりにtemplate_dirの定義を追加。
    Read More

    read more
    0 comments

    bakeで雛型を作る

    by outsider タグ: cakephp, php
    06 08 2009

    DBにテーブルをあらかじめ作成しておく。
    今回使うテーブルは「servers」。

  • bakeの実行
  • Read More

    read more
    0 comments

    cakephpにsimpletest

    by outsider タグ: cakephp, php
    06 08 2009
  • ダウンロード
  • simpletestからダウンロードして、[cakeのインストール先]/app/vendors/simpletestに設置。

    $ cd [cakeのインストール先]/app/vendors
    $ tar zxpf simpletest_1.0.1.tar.gz
    
  • 動作確認
  • http://[cakeをインストール]したサーバ]/test.php

    read more
    0 comments

    cakephp smartyのテンプレートのパスを変更

    by outsider タグ: cakephp, php
    05 08 2009

    templateの場所を
    app/views/pages/smarty/display.tplからapp/views/pages/display.tplに変更する。

    app/config/core.phpの最後に

        Configure::write('Smarty.subDir', '');
        Configure::write('Smarty.layoutPath', '');
    

    を追加。

    read more
    0 comments

    cakephp最初のコントローラー

    by outsider タグ: cakephp, php
    05 08 2009

    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
    
    read more
    0 comments

    cakephpでSmartyを使う

    by outsider タグ: cakephp, php
    05 08 2009
  • ダウンロード
  • Smarty Downloadからダウンロード。
    Read More

    read more
    0 comments

    cakephp導入

    by outsider タグ: cakephp, php
    05 08 2009
  • ダウンロード
  • ここから最新版のダウンロード。

  • ファイルの設置
  • $ tar zxpf cake_1.2.5.tar.gz   # 展開
    $ cd cake_1.2.5
    $ chown -R apache app/tmp          # apacheが書き込みできるように
  • bootstrap.php
  • 各クラスのパスを追加したい場合は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,
    );
    
  • databases.php
  • データベースの設定。

  • core.php
  • Configure::write('Routing.admin', 'admin');
    Configure::write('debug', 2);
    Configure::write('App.encoding', 'UTF-8');
    Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');
    
    read more
    0 comments

    google adsense

    カテゴリー

    • CentOS
    • php
      • cakephp
    • Windows
    • wordpress

    タグ

    cakephp CentOS munin php Windows wordpress yum
    Design by: Bingo - The Web Design Experts