noto's blog
2010年を振り返る意味で、自分がCakePHPで開発する際に良く使うプラグインをまとめてみました。 誰かのお役に立てれば幸いです。 1.cakeplus ■ よく使うバリデーションをまとめたBehaviorであるadd_validation_rule モデルでバリデーションする際に本当に使います。 var $validate = array( 'hoge' => array( "rule1" => array('rule' => array('katakana_only'), 'message' => 'hogeにカタカナ以外が含まれています' ), ), ); ■ 自動でhiddenタグを生成するヘルパーformhidden 確認画面を挟む際にhiddenに入力情報をまとめて出力してくれます。 echo $formhidden->hiddenVars(); このプラグインを知ってから、
CSSフレームワークのような、Webアプリのフロント用ツールキットのような、TwitterのBootstrapがいい感じです。フォームのmargin/paddingの具合やプリセットの表現がほんとスマートで、やりすぎないのにすごく丁寧。 http://twitter.github.com/bootstrap/ そのBootstrapのかっこいいフォームのスタイリングなんかをCakePHPでさくっと使えるようにしたプラグインがこちらにあります。 https://github.com/slywalker/TwitterBootstrap このGitHubプロジェクトをまるごとCake2の app/Plugin/TwitterBootstrap に入れる。 app/Plugin/TwitterBootstrap/webroot に bootstrap の js, css, img をぶちまけ。
11. <?php $keyword = ''; if (isset($_POST['keyword'])) { $keyword = $_POST['keyword']; } mysql_connect('localhost','user','password'); mysql_select_db('cakephp_sample'); mysql_query('set names utf8'); $sql = sprintf( "SELECT id,name,description FROM friends WHERE name LIKE '%s'", mysql_real_escape_string('%'.$keyword.'%') ); $result = mysql_query($sql); $data = array(); while ($row = mysql_fetch_a
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く