PHP 클래스 kartik\builder\Form

Usage example: ~~~ use kartik\form\ActiveForm; use kartik\builder\Form; $form = ActiveForm::begin($options); // $options will be your form config array params. echo Form::widget([ 'model' => $model, // your model 'form' => $form, 'columns' => 2, 'attributes' => [ 'username' => ['type' => Form::INPUT_TEXT, 'options'=> ['placeholder'=>'Enter username...']], 'password' => ['type' => Form::INPUT_PASSWORD], 'rememberMe' => ['type' => Form::INPUT_CHECKBOX, 'enclosedByLabel' => true], ] ]); ActiveForm::end(); ~~~
부터: 1.0
저자: Kartik Visweswaran ([email protected])
상속: extends BaseForm
파일 보기 프로젝트 열기: kartik-v/yii2-builder 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$autoGenerateColumns calculate the number of columns automatically based on count of attributes configured in the Form widget. Columns will be created maximum upto the [[GRID_WIDTH]].
$columnOptions the HTML attributes for the grid columns. Applicable only if [[columns]] is greater than 1.
$columnSize the bootstrap device size for rendering each grid column. Defaults to [[SIZE_SMALL]].
$columns the number of columns in which to split the fields horizontally. If not set, defaults to 1 column.
$contentAfter content to display after the generated form fields. This is not HTML encoded.
$contentBefore content to display before the generated form fields. This is not HTML encoded.
$model the data model used for the form.
$options the HTML attributes for the field/attributes container. The following options are additionally recognized: - tag: _string_, the HTML tag for the container. Defaults to fieldset.
$rowOptions the HTML attributes for the rows. Applicable only if [[columns]] is greater than 1.

공개 메소드들

메소드 설명
init ( )
run ( )

보호된 메소드들

메소드 설명
beginTag ( string $tag, array $options = [], boolean $skip = false ) : string Begins a tag markup based on orientation.
endTag ( string $tag, boolean $skip = false ) : string Ends a tag markup based on orientation.
getSubAttributesContent ( array $settings, string $index ) : string Gets sub attribute markup content.
initOptions ( ) Initializes the widget options
parseInput ( string $attribute, string $settings, integer $index ) : string Parses the input markup based on type.
raise ( string $event = '', string $attribute = '', integer | string $index = '', array $data = [] ) Triggers an ActiveFormEvent.
registerAssets ( ) Registers widget assets
renderFieldSet ( ) : string Renders the field set.
renderSubAttributes ( array $settings, string $index ) : string Render sub attributes.

메소드 상세

beginTag() 보호된 메소드

Begins a tag markup based on orientation.
protected beginTag ( string $tag, array $options = [], boolean $skip = false ) : string
$tag string the HTML tag
$options array the HTML attributes for the tag
$skip boolean whether to skip the tag generation
리턴 string

endTag() 보호된 메소드

Ends a tag markup based on orientation.
protected endTag ( string $tag, boolean $skip = false ) : string
$tag string the HTML tag
$skip boolean whether to skip the tag generation
리턴 string

getSubAttributesContent() 보호된 메소드

Gets sub attribute markup content.
protected getSubAttributesContent ( array $settings, string $index ) : string
$settings array the attribute settings
$index string the zero-based index of the attribute
리턴 string

init() 공개 메소드

public init ( )

initOptions() 보호된 메소드

Initializes the widget options
protected initOptions ( )

parseInput() 보호된 메소드

Parses the input markup based on type.
protected parseInput ( string $attribute, string $settings, integer $index ) : string
$attribute string the model attribute.
$settings string the column settings.
$index integer the row index.
리턴 string the generated input.

raise() 보호된 메소드

Triggers an ActiveFormEvent.
protected raise ( string $event = '', string $attribute = '', integer | string $index = '', array $data = [] )
$event string the event name.
$attribute string the attribute name.
$index integer | string the row index.
$data array the event data to pass to the event.

registerAssets() 보호된 메소드

Registers widget assets
protected registerAssets ( )

renderFieldSet() 보호된 메소드

Renders the field set.
protected renderFieldSet ( ) : string
리턴 string

renderSubAttributes() 보호된 메소드

Render sub attributes.
protected renderSubAttributes ( array $settings, string $index ) : string
$settings array the attribute settings
$index string the zero-based index of the attribute
리턴 string

run() 공개 메소드

public run ( )

프로퍼티 상세

$autoGenerateColumns 공개적으로 프로퍼티

calculate the number of columns automatically based on count of attributes configured in the Form widget. Columns will be created maximum upto the [[GRID_WIDTH]].
public $autoGenerateColumns

$columnOptions 공개적으로 프로퍼티

the HTML attributes for the grid columns. Applicable only if [[columns]] is greater than 1.
public $columnOptions

$columnSize 공개적으로 프로퍼티

the bootstrap device size for rendering each grid column. Defaults to [[SIZE_SMALL]].
public $columnSize

$columns 공개적으로 프로퍼티

the number of columns in which to split the fields horizontally. If not set, defaults to 1 column.
public $columns

$contentAfter 공개적으로 프로퍼티

content to display after the generated form fields. This is not HTML encoded.
public $contentAfter

$contentBefore 공개적으로 프로퍼티

content to display before the generated form fields. This is not HTML encoded.
public $contentBefore

$model 공개적으로 프로퍼티

the data model used for the form.
public $model

$options 공개적으로 프로퍼티

the HTML attributes for the field/attributes container. The following options are additionally recognized: - tag: _string_, the HTML tag for the container. Defaults to fieldset.
public $options

$rowOptions 공개적으로 프로퍼티

the HTML attributes for the rows. Applicable only if [[columns]] is greater than 1.
public $rowOptions