本文整理汇总了PHP中Zend\Form\Element\File::setLabelAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP File::setLabelAttributes方法的具体用法?PHP File::setLabelAttributes怎么用?PHP File::setLabelAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Form\Element\File
的用法示例。
在下文中一共展示了File::setLabelAttributes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($name = null, $options = array())
{
parent::__construct(isset($name) ? $name : 'personal');
$id_hidden = new Element\Hidden('id');
$id_hidden->setName('id');
$firstname_text = new Element\Text('firstname');
$firstname_text->setLabel('First name');
$firstname_text->setLabelAttributes(array('class' => 'type_text'));
$firstname_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...'));
$lastname_text = new Element\Text('lastname');
$lastname_text->setLabel('Last name');
$lastname_text->setLabelAttributes(array('class' => 'type_text'));
$lastname_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'required' => true));
$country_select = new Element\Select('country_id');
$country_select->setLabel('Country');
$country_select->setLabelAttributes(array('class' => 'select f_3_w50'));
$country_select->setAttributes(array('class' => 'sel_chosen'));
$country_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your country'));
$state_select = new Element\Select('state_id');
$state_select->setLabel('Province/State');
$state_select->setLabelAttributes(array('class' => 'select f_3_w50'));
$state_select->setAttributes(array('class' => 'sel_chosen', 'required' => true));
$state_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your state'));
$city_select = new Element\Select('city_id');
$city_select->setLabel('City');
$city_select->setLabelAttributes(array('class' => 'select f_3_w50'));
$city_select->setAttributes(array('class' => 'sel_chosen', 'required' => true));
$city_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your city'));
$adress_text = new Element\Text('adress');
$adress_text->setLabel('Adress');
$adress_text->setLabelAttributes(array('class' => 'type_text'));
$adress_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type adress in format (наш формат)'));
$languages_select = new Element\Select('languages');
$languages_select->setLabel('Languages');
$languages_select->setLabelAttributes(array('class' => 'select', 'style' => 'float:left;'));
$languages_select->setAttributes(array('class' => 'sel_chosen', 'multiple' => 'multiple', 'required' => true));
$languages_select->setOptions(array('disable_inarray_validator' => true));
$logo = new Element\Image('logo');
$logo->setAttributes(array('src', '/images/11.jpg', 'style' => 'float:left;'));
$file = new Element\File('file');
$file->setLabelAttributes(array('style' => 'float:left;clear:both'));
$this->add($id_hidden);
$this->add($firstname_text);
$this->add($lastname_text);
$this->add($country_select);
$this->add($state_select);
$this->add($city_select);
$this->add($adress_text);
$this->add($languages_select);
$this->add($logo);
$this->add($file);
}
示例2: addElements
public function addElements()
{
//-- File --
$file = new Element\File('file');
$file->setAttribute('placeholder', 'profile_name');
$file->setAttribute('required', 'true');
$file->setAttribute('class', 'form-control');
$file->setAttribute('id', 'file');
$file->setLabel('Profile name');
$file->setLabelAttributes(array('class' => 'control-label', 'for' => 'file'));
//-- Submit --
$submit = new Element\Submit('submit');
$submit->setAttribute('class', 'btn btn-success');
$submit->setValue('Send');
//-- Binding elements --
$this->add($file);
$this->add($submit);
}