ysku's blog

ウェブ・無線通信・組み込みとか

CakePHPのForm Helperの使い方

f:id:yusuke1581:20141112005253j:plain
簡単にまとめてみました.

<?php
        echo $this->Form->input('name_last', array(
                'label' => false,  → 生成されるinputタグをlabelで囲むかどうかを指定
                'type' => 'text', → フォームに入力される値のタイプ(ex text, checkbox, file, etc...)
                'class' => 'form-control form-name',  → inputタブにつけるクラスの指定
                'div' => array( → 生成されるinputタグを囲むdiv要素へのクラスを指定
                        'class' => 'input input-name',
                ),
                'placeholder' => '姓', → フォーム内に表示される文字列の指定
        ));
?>