[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

タグ

関連タグで絞り込む (2)

タグの絞り込みを解除

cakephpに関するsnowlongのブックマーク (7)

  • CakePHPのセレクトメニューでよく使う配列

    <?php echo $this->form->input('Model.field', array( 'div'=>false, 'label'=>false, 'options'=>$options )); ?> Formヘルパーのselectを使いたくて、その中のoptionにセットする値を配列で渡したいぜって時。 Viewに書くのはいやだから、コントローラーで配列にして $this->set('options', $options); とかで渡すのが便利ですよね。 そしてその配列はこうなってなきゃいけない。

    CakePHPのセレクトメニューでよく使う配列
    snowlong
    snowlong 2014/06/10
    arrayをセレクタに渡したいときに
  • ページネーションを利用する

    cakePHPにはページネーションという便利な機能が搭載されてるらしい。 それを使うと、簡単にページの分割やリンクによるソートなどができるようになるそうな。というわけで、今回はそのページネーションについてまとめる。 使い方 主にコントローラー内とビュー内で使用する。 コントローラー内での操作 基の使い方は以下の通り。 $data = $this->paginate() ずいぶんと簡単でございますね。上記の場合、命名規約により自動的にコントローラーに対応するモデルが選ばれ、$this->Model->find('all')と同じリクエストが発行されてデータが吐き出される。 なお、デフォルトでは20件のデータが呼び出されるみたい。あと第一引数にモデル名を指定することもできる。 【下記の結果は事実上同じ】//PostalCodesController内 $result = $this->Pos

    snowlong
    snowlong 2014/05/29
    Pager
  • selectボックスを実装

    今まで、selectボックスのgroupを作成するのにSet::Combineを使用していましたが、意外と簡単にできることに気付いてしまったので、ご紹介。(自分だけ知らなかったことに気付いた と言ったほうが近い。) デモ(データ配列なども) モデルは、散々出尽くしているかもしれませんが、以下 CREATE TABLE IF NOT EXISTS `prefectures` ( `id` INT NOT NULL AUTO_INCREMENT, -- id `prefecture` VARCHAR(8) NOT NULL, -- 都道府県 `area` VARCHAR(8) NOT NULL, -- 地方 PRIMARY KEY (`id`) ) 単一選択のselectボックス 一般的なセレクトボックス。中から1つを選ぶものです。 find('list')でfieldsに対して2項目設定しま

    selectボックスを実装
  • builwing.info

    This domain name registration has expired and renewal or deletion are pending. If you are the registrant and want to renew the domain name, please contact your registration service provider.

  • tsuchinokopro.com

    tsuchinokopro.com 2018 Copyright. All Rights Reserved. The Sponsored Listings displayed above are served automatically by a third party. Neither the service provider nor the domain owner maintain any relationship with the advertisers. In case of trademark issues please contact the domain owner directly (contact information can be found in whois). Privacy Policy

  • 第11回 CakePHPの「DEBUG値」を極める! | gihyo.jp

    今回はCakePHPのデバッグに重要な「DEBUG値」を極めます。CakePHPバージョンは1.1系を対象としています。 DEBUG値とは DEBUG値は、app/config/core.php内で定義するDEBUG定数の値です。 app/config/core.php /** * Set debug level here: * - 0: production * - 1: development * - 2: full debug with sql * - 3: full debug with sql and dump of the current object * * In production, the "flash messages" redirect after a time interval. * With the other debug levels you get to c

    第11回 CakePHPの「DEBUG値」を極める! | gihyo.jp
  • Code Life

    noto's blog

    snowlong
    snowlong 2012/10/14
    "何の設定もしていないvimは糞みたいなエディタ"
  • 1