本文整理汇总了PHP中FormField::FormField方法的典型用法代码示例。如果您正苦于以下问题:PHP FormField::FormField方法的具体用法?PHP FormField::FormField怎么用?PHP FormField::FormField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormField
的用法示例。
在下文中一共展示了FormField::FormField方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FormFileUploader
function FormFileUploader($fieldId, $field_options)
{
parent::FormField($fieldId, $field_options);
foreach ($field_options as $attribute => $value) {
$attribute = strtolower($attribute);
switch ($attribute) {
case 'size':
$this->field_size = $value;
break;
default:
$this->throw_error(sprintf('Unsupported option %s with field ' . __CLASS__, $attribute), E_USER_NOTICE);
}
}
}
示例2: FormRadioChoice
function FormRadioChoice()
{
$fieldId = func_get_arg(0);
$field_options = func_get_arg(1);
parent::FormField($fieldId, $field_options);
foreach ($field_options as $attribute => $value) {
$this->throw_error(sprintf('Unsupported option %s with field ' . __CLASS__, strtolower($attribute)), E_USER_NOTICE);
}
$nbr_arg = func_num_args() - 1;
for ($i = 2; $i <= $nbr_arg; $i++) {
$option = func_get_arg($i);
$this->add_errors($option->get_errors());
$this->field_options[] = $option;
}
}
示例3: FormRadioChoiceOption
function FormRadioChoiceOption($field_options)
{
parent::FormField('', $field_options);
foreach ($field_options as $attribute => $value) {
$attribute = strtolower($attribute);
switch ($attribute) {
case 'optiontitle':
$this->option_title = $value;
break;
case 'checked':
$this->option_checked = $value;
break;
default:
$this->throw_error(sprintf('Unsupported option %s with field option ' . __CLASS__, $attribute), E_USER_NOTICE);
}
}
}
示例4: FormSelect
function FormSelect()
{
$fieldId = func_get_arg(0);
$field_options = func_get_arg(1);
parent::FormField($fieldId, $field_options);
foreach ($field_options as $attribute => $value) {
$attribute = strtolower($attribute);
switch ($attribute) {
case 'multiple':
$this->field_multiple = $value;
break;
default:
$this->throw_error(sprintf('Unsupported option %s with field option ' . __CLASS__, $attribute), E_USER_NOTICE);
}
}
$nbr_arg = func_num_args() - 1;
for ($i = 2; $i <= $nbr_arg; $i++) {
$option = func_get_arg($i);
$this->add_errors($option->get_errors());
$this->field_options[] = $option;
}
}
示例5: FormTextarea
function FormTextarea($fieldId, $fieldOptions)
{
parent::FormField($fieldId, $fieldOptions);
foreach ($fieldOptions as $attribute => $value) {
$attribute = strtolower($attribute);
switch ($attribute) {
case 'rows':
$this->field_rows = $value;
break;
case 'cols':
$this->field_cols = $value;
break;
case 'editor':
$this->field_editor = $value;
break;
case 'forbiddentags':
$this->field_forbidden_tags = $value;
break;
default:
$this->throw_error(sprintf('Unsupported option %s with field ' . __CLASS__, $attribute), E_USER_NOTICE);
}
}
}
示例6: FormHiddenField
function FormHiddenField($fieldId, $field_options)
{
parent::FormField($fieldId, $field_options);
}