もしかしてですが、使用しているCakePHPのバージョンは3.3かそれ以前ではないでしょうか?
3.4 移行ガイド
こちらによると、$this->Form->control メソッドはCakePHP3.4で追加されているようです。
ちなみに実装は以下のようになっており、3.3以前の input メソッドが名称変更されたようです。
input メソッド
php
1 public function input($fieldName, array $options = [])
2 {
3 return $this->control($fieldName, $options);
4 }
control メソッド
蛇足:
フォームの出力タグは、オプションの templates を変更することでコントロールすることが出来ます。
都度指定することも出来ますが、設定ファイルでまとめて指定することも出来ます。
FormHelper で使用するテンプレートのカスタマイズ
指定できる templates のデフォルトは以下になります。
cakephp/FormHelper.php at master · cakephp/cakephp
php
1 'templates' => [
2 'button' => '<button{{attrs}}>{{text}}</button>',
3 'checkbox' => '<input type="checkbox" name="{{name}}" value="{{value}}"{{attrs}}>',
4 'checkboxFormGroup' => '{{label}}',
5 'checkboxWrapper' => '<div class="checkbox">{{label}}</div>',
6 'dateWidget' => '{{year}}{{month}}{{day}}{{hour}}{{minute}}{{second}}{{meridian}}',
7 'error' => '<div class="error-message">{{content}}</div>',
8 'errorList' => '<ul>{{content}}</ul>',
9 'errorItem' => '<li>{{text}}</li>',
10 'file' => '<input type="file" name="{{name}}"{{attrs}}>',
11 'fieldset' => '<fieldset{{attrs}}>{{content}}</fieldset>',
12 'formStart' => '<form{{attrs}}>',
13 'formEnd' => '</form>',
14 'formGroup' => '{{label}}{{input}}',
15 'hiddenBlock' => '<div style="display:none;">{{content}}</div>',
16 'input' => '<input type="{{type}}" name="{{name}}"{{attrs}}/>',
17 'inputSubmit' => '<input type="{{type}}"{{attrs}}/>',
18 'inputContainer' => '<div class="input {{type}}{{required}}">{{content}}</div>',
19 'inputContainerError' => '<div class="input {{type}}{{required}} error">{{content}}{{error}}</div>',
20 'label' => '<label{{attrs}}>{{text}}</label>',
21 'nestingLabel' => '{{hidden}}<label{{attrs}}>{{input}}{{text}}</label>',
22 'legend' => '<legend>{{text}}</legend>',
23 'multicheckboxTitle' => '<legend>{{text}}</legend>',
24 'multicheckboxWrapper' => '<fieldset{{attrs}}>{{content}}</fieldset>',
25 'option' => '<option value="{{value}}"{{attrs}}>{{text}}</option>',
26 'optgroup' => '<optgroup label="{{label}}"{{attrs}}>{{content}}</optgroup>',
27 'select' => '<select name="{{name}}"{{attrs}}>{{content}}</select>',
28 'selectMultiple' => '<select name="{{name}}[]" multiple="multiple"{{attrs}}>{{content}}</select>',
29 'radio' => '<input type="radio" name="{{name}}" value="{{value}}"{{attrs}}>',
30 'radioWrapper' => '{{label}}',
31 'textarea' => '<textarea name="{{name}}"{{attrs}}>{{value}}</textarea>',
32 'submitContainer' => '<div class="submit">{{content}}</div>',
33 ]
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/03/28 12:25
2017/03/29 01:10