本文整理汇总了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);
}