開発メモ

開発用のメモです。

Cakephp + Bootstrap でフォーム(横並び)

Controller

<?php
var $helpers = array(
    'Html' => array('className' => 'TwitterBootstrap.BootstrapHtml'), 
    'Form' => array('className' => 'TwitterBootstrap.BootstrapForm'), 
    'Paginator' => array('className' => 'TwitterBootstrap.BootstrapPaginator'), 
);

View

<?php
echo $this -> Html -> nestedList(array($this -> Html -> link("home", "/"), $this -> Html -> link("admins", array("plugin" => "admins", "controller" => "admins", "action" => "index")), $this -> Html -> link("users", array("plugin" => "admins", "controller" => "users", "action" => "index")), "edit"), array("class" => "pan"));
echo $this -> Form -> create("User", array("class" => "form form-horizontal"));
echo $this -> Form -> input("username", array("label" => array("class" => "col-sm-2 ","text"=>__d("admins", "username")),"div" => array("class" => "col-sm-10 ")));
echo $this -> Form -> end();
Twitter: @asahina_alice