本文整理匯總了PHP中kartik\widgets\ActiveForm::field方法的典型用法代碼示例。如果您正苦於以下問題:PHP ActiveForm::field方法的具體用法?PHP ActiveForm::field怎麽用?PHP ActiveForm::field使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類kartik\widgets\ActiveForm
的用法示例。
在下文中一共展示了ActiveForm::field方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _fieldWithAccessRules
private function _fieldWithAccessRules($model, $attribute, $options, $rule)
{
switch ($this->_verifyAccessRules($rule)) {
case self::EDITABLE:
return parent::field($model, $attribute, $options);
case self::NONEDITABLE:
return parent::field($model, $attribute, array_merge($options, ['template' => '{label}' . $model->{$attribute}]));
case self::INVISIBLE:
return;
}
}
示例2: field
/**
* Generates a form field.
* A form field is associated with a model and an attribute. It contains a label, an input and an error message
* and use them to interact with end users to collect their inputs for the attribute.
* @param Model $model the data model
* @param string $attribute the attribute name or expression. See [[Html::getAttributeName()]] for the format
* about attribute expression.
* @param array $options the additional configurations for the field object
* @return ActiveField the created ActiveField object
* @see fieldConfig
*/
public function field($model, $attribute, $options = [])
{
return parent::field($model, $attribute, $options);
}