Generates option lists for common menus
protected _generateOptions ( string $name, array $options = [] ) : array
$name
string
List type name.
$options
array
Options list.
return
array
_getId()
protected method
フォームのIDを取得する
BcForm::create より呼出される事が前提
protected _getId ( string $model = null, array $options = [] ) : string
$model
string
$options
array
return
string
_selectOptions()
protected method
Returns an array of formatted OPTION/OPTGROUP elements
protected _selectOptions ( array $elements = [], array $parents = [], boolean $showParents = null, array $attributes = [] ) : array
$elements
array
$parents
array
$showParents
boolean
$attributes
array
return
array
checkbox()
public method
MODIFIED 2008/10/24 egashira
hiddenタグを出力しないオプションを追加
### Options:
- value - the value of the checkbox
- checked - boolean indicate that this checkbox is checked.
- hiddenField - boolean to indicate if you want the results of checkbox() to include
a hidden input with a value of ''.
- disabled - create a disabled input.
- default - Set the default value for the checkbox. This allows you to start checkboxes
as checked, without having to check the POST data. A matching POST data value, will overwrite
the default value.
See link:
http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#options-for-select-checkbox-and-radio-inputs
public checkbox ( string $fieldName, array $options = [] ) : string
$fieldName
string
Name of a field, like this "Modelname.fieldname"
$options
array
Array of HTML attributes.
return
string
An HTML text input element.
ckeditor()
public method
CKEditorを出力する
public ckeditor ( string $fieldName, array $options = [] ) : string
$fieldName
string
$options
array
return
string
create()
public method
create
フック用にラッピング
public create ( array $model = null, array $options = [] ) : string
$model
array
$options
array
return
string
dateTime()
public method
### Attributes:
- monthNames If false, 2 digit numbers will be used instead of text.
If a array, the given array will be used.
- minYear The lowest year to use in the year select
- maxYear The maximum year to use in the year select
- interval The interval for the minutes select. Defaults to 1
- separator The contents of the string between select elements. Defaults to '-'
- empty - If true, the empty select option is shown. If a string,
that string is displayed as the empty element.
- round - Set to up or down if you want to force rounding in either direction. Defaults to null.
- value | default The default value to be used by the input. A value in $this->data
matching the field name will override this value. If no default is provided time() will be used.
See link:
http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::dateTime
public dateTime ( string $fieldName, string $dateFormat = 'DMY', string $timeFormat = '12', array $attributes = [] ) : string
$fieldName
string
Prefix name for the SELECT element
$dateFormat
string
DMY, MDY, YMD, or null to not generate date inputs.
- W が入力された場合、和暦のselectと年月日の接尾辞が付与される
$timeFormat
string
12, 24, or null to not generate time inputs.
$attributes
array
Array of Attributes
return
string
Generated set of select boxes for the date and time formats chosen.
dateTimePicker()
public method
日付カレンダーと時間フィールド
public dateTimePicker ( string $fieldName, array $attributes = [] ) : string
$fieldName
string
$attributes
array
return
string
datepicker()
public method
カレンダーコントロール付きのテキストフィールド
jquery-ui-1.7.2 必須
public datepicker ( $fieldName, $attributes = [] ) : string
return
string
html
dispatchAfterForm()
public method
### 発動側
フォームのの直前に記述して利用する
### コールバック処理
プラグインのコールバック処理で CakeEvent::data['fields'] に
配列で行データを追加する事でフォームの最後に行を追加する事ができる。
### イベント名
コントローラー名.Form.afterForm Or コントローラー名.Form.afterOptionForm
### 行データのキー(配列)
- title:見出欄
- input:入力欄
### 行データの追加例
$View = $event->subject(); // $event は、CakeEvent
$input = $View->BcForm->input('Page.add_field', array('type' => 'input'));
$event->data['fields'][] = array(
'title' => '追加フィールド',
'input' => $input
);
public dispatchAfterForm ( string $type = '' ) : string
$type
string
フォームのタイプ タイプごとにイベントの登録ができる
return
string
行データ
editor()
public method
エディタを表示する
public editor ( string $fieldName, array $options = [] ) : string
$fieldName
string
$options
array
return
string
end()
public method
end
フック用にラッピング
public end ( array $options = null, $secureAttributes = [] ) : string
$options
array
return
string
file()
public method
画像の場合は画像タグ、その他の場合はファイルへのリンク
そして削除用のチェックボックスを表示する
《オプション》
imgsize 画像のサイズを指定する
rel A タグの rel 属性を指定
title A タグの title 属性を指定
link 大きいサイズへの画像へのリンク有無
delCheck 削除用チェックボックスの利用可否
force ファイルの存在有無に関わらず強制的に画像タグを表示するかどうか
public file ( string $fieldName, array $options = [] ) : string
$fieldName
string
$options
array
return
string
generateList()
public method
モデルよりリストを生成する
public generateList ( string $modelName, mixed $conditions = [], mixed $fields = [], mixed $order = [] ) : mixed
$modelName
string
$conditions
mixed
$fields
mixed
$order
mixed
return
mixed
リストまたは、false
getControlSource()
public method
コントロールソースを取得する
Model側でメソッドを用意しておく必要がある
public getControlSource ( string $field, array $options = [] ) : array
$field
string
フィールド名
$options
array
return
array
コントロールソース
hidden()
public method
Creates a hidden input field.
See link:
http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::hidden
public hidden ( string $fieldName, array $options = [] ) : string
$fieldName
string
Name of a field, in the form of "Modelname.fieldname"
$options
array
Array of HTML attributes.
return
string
A generated hidden input
input()
public method
Options - See each field type method for more information. Any options that are part of
$attributes or $options for the different type methods can be included in $options for input().
- 'type' - Force the type of widget you want. e.g. type => 'select'
- 'label' - control the label
- 'div' - control the wrapping div element
- 'options' - for widgets that take options e.g. radio, select
- 'error' - control the error message that is produced
public input ( string $fieldName, array $options = [] ) : string
$fieldName
string
This should be "Modelname.fieldname"
$options
array
Each type of input takes different options.
return
string
Completed form widget
jsonList()
public method
JsonList
public jsonList ( string $field, string $attributes ) : array
$field
string
フィールド文字列
$attributes
string
return
array
属性
prefTag()
public method
都道府県用のSELECTタグを表示する
public prefTag ( string $fieldName, mixed $selected = null, array $attributes = [] ) : string
$fieldName
string
Name attribute of the SELECT
$selected
mixed
Selected option
$attributes
array
Array of HTML options for the opening SELECT element
return
string
都道府県用のSELECTタグ
radio()
public method
You can also customize each radio input element using an array of arrays:
$options = array(
array('name' => 'United states', 'value' => 'US', 'title' => 'My title'),
array('name' => 'Germany', 'value' => 'DE', 'class' => 'de-de', 'title' => 'Another title'),
);
### Attributes:
- separator - define the string in between the radio buttons
- between - the string between legend and input set or array of strings to insert
strings between each input block
- legend - control whether or not the widget set has a fieldset & legend
- fieldset - sets the class of the fieldset. Fieldset is only generated if legend attribute is provided
- value - indicate a value that is should be checked
- label - boolean to indicate whether or not labels for widgets show be displayed
- hiddenField - boolean to indicate if you want the results of radio() to include
a hidden input with a value of ''. This is useful for creating radio sets that non-continuous
- disabled - Set to true or disabled to disable all the radio buttons.
- empty - Set to true to create an input with the value '' as the first option. When true
the radio label will be 'empty'. Set this option to a string to control the label value.
See link:
http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#options-for-select-checkbox-and-radio-inputs
public radio ( string $fieldName, array $options = [], array $attributes = [] ) : string
$fieldName
string
Name of a field, like this "Modelname.fieldname"
$options
array
Radio button options array.
$attributes
array
Array of HTML attributes, and special attributes above.
return
string
Completed radio widget set.
select()
public method
### Attributes:
- showParents - If included in the array and set to true, an additional option element
will be added for the parent of each option group. You can set an option with the same name
and it's key will be used for the value of the option.
- multiple - show a multiple select box. If set to 'checkbox' multiple checkboxes will be
created instead.
- empty - If true, the empty select option is shown. If a string,
that string is displayed as the empty element.
- escape - If true contents of options will be HTML entity encoded. Defaults to true.
- value The selected value of the input.
- class - When using multiple = checkbox the class name to apply to the divs. Defaults to 'checkbox'.
- disabled - Control the disabled attribute. When creating a select box, set to true to disable the
select box. When creating checkboxes, true will disable all checkboxes. You can also set disabled
to a list of values you want to disable when creating checkboxes.
### Using options
A simple array will create normal options:
$options = array(1 => 'one', 2 => 'two);
$this->Form->select('Model.field', $options));
While a nested options array will create optgroups with options inside them.
$options = array(
1 => 'bill',
'fred' => array(
2 => 'fred',
3 => 'fred jr.'
)
);
$this->Form->select('Model.field', $options);
In the above 2 => 'fred' will not generate an option element. You should enable the showParents
attribute to show the fred option.
If you have multiple options that need to have the same value attribute, you can
use an array of arrays to express this:
$options = array(
array('name' => 'United states', 'value' => 'USA'),
array('name' => 'USA', 'value' => 'USA'),
);
See link:
http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#options-for-select-checkbox-and-radio-inputs
public select ( string $fieldName, array $options = [], array $attributes = [] ) : string
$fieldName
string
Name attribute of the SELECT
$options
array
Array of the OPTION elements (as 'value'=>'Text' pairs) to be used in the
SELECT element
$attributes
array
The HTML attributes of the select element.
return
string
Formatted SELECT element
selectText()
public method
文字列保存用複数選択コントロール
public selectText ( string $fieldName, array $options = [], mixed $selected = null, array $attributes = [], mixed $showEmpty = '' ) : string
$fieldName
string
id,nameなどの名前
$options
array
optionタグの値
$selected
mixed
selectedを付与する要素
$attributes
array
htmlの属性
$showEmpty
mixed
空要素の表示/非表示、初期値
return
string
submit()
public method
### Options
- div - Include a wrapping div? Defaults to true. Accepts sub options similar to
FormHelper::input().
- before - Content to include before the input.
- after - Content to include after the input.
- type - Set to 'reset' for reset inputs. Defaults to 'submit'
- Other attributes will be assigned to the input element.
### Options
- div - Include a wrapping div? Defaults to true. Accepts sub options similar to
FormHelper::input().
- Other attributes will be assigned to the input element.
See link:
http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::submit
public submit ( string $caption = null, array $options = [] ) : string
$caption
string
The label appearing on the button OR if string contains :// or the
extension .jpg, .jpe, .jpeg, .gif, .png use an image if the extension
exists, AND the first character is /, image is relative to webroot,
OR if the first character is not /, image is relative to webroot/img.
$options
array
Array of options. See above.
return
string
A HTML submit button
wyear()
public method
和暦年
public wyear ( string $fieldName, integer $minYear = null, integer $maxYear = null, string $selected = null, array $attributes = [], boolean $showEmpty = true ) : string
$fieldName
string
Prefix name for the SELECT element
$minYear
integer
First year in sequence
$maxYear
integer
Last year in sequence
$selected
string
Option which is selected.
$attributes
array
Attribute array for the select elements.
$showEmpty
boolean
Show/hide the empty select option
return
string
Property Details
$helpers public_oe property
---
public $helpers
$sizeCounterFunctionLoaded public_oe property
sizeCounter用の関数読み込み可否
public bool $sizeCounterFunctionLoaded
return
boolean
热门功能 |
热门类
|
文档
| 隐私政策
| Advertise with us
PHP
| C# (CSharp)
| Java
| Golang
| C++ (Cpp)
| Python
| JavaScript
| TypeScript
EN
| RU
| DE
| FR
| ES
| PT
| IT
| JP
| ZH
| KO