本文整理汇总了PHP中Zend_Form_Element_Radio::setMultiOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Radio::setMultiOptions方法的具体用法?PHP Zend_Form_Element_Radio::setMultiOptions怎么用?PHP Zend_Form_Element_Radio::setMultiOptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element_Radio
的用法示例。
在下文中一共展示了Zend_Form_Element_Radio::setMultiOptions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: startFrom
public function startFrom()
{
$setting = $this->setting;
if (Application_Model_Preference::GetPlanLevel() == 'disabled') {
$output_sound_device = new Zend_Form_Element_Checkbox('output_sound_device');
$output_sound_device->setLabel('Hardware Audio Output')->setRequired(false)->setValue($setting['output_sound_device'] == "true" ? 1 : 0)->setDecorators(array('ViewHelper'));
if (Application_Model_Preference::GetEnableStreamConf() == "false") {
$output_sound_device->setAttrib("readonly", true);
}
$this->addElement($output_sound_device);
$output_types = array("ALSA" => "ALSA", "AO" => "AO", "OSS" => "OSS", "Portaudio" => "Portaudio", "Pulseaudio" => "Pulseaudio");
$output_type = new Zend_Form_Element_Select('output_sound_device_type');
$output_type->setLabel("Output Type")->setMultiOptions($output_types)->setValue($setting['output_sound_device_type'])->setDecorators(array('ViewHelper'));
if ($setting['output_sound_device'] != "true") {
$output_type->setAttrib("disabled", "disabled");
}
$this->addElement($output_type);
}
$icecast_vorbis_metadata = new Zend_Form_Element_Checkbox('icecast_vorbis_metadata');
$icecast_vorbis_metadata->setLabel('Icecast Vorbis Metadata')->setRequired(false)->setValue($setting['icecast_vorbis_metadata'] == "true" ? 1 : 0)->setDecorators(array('ViewHelper'));
if (Application_Model_Preference::GetEnableStreamConf() == "false") {
$icecast_vorbis_metadata->setAttrib("readonly", true);
}
$this->addElement($icecast_vorbis_metadata);
$stream_format = new Zend_Form_Element_Radio('streamFormat');
$stream_format->setLabel('Stream Label:');
$stream_format->setMultiOptions(array("Artist - Title", "Show - Artist - Title", "Station name - Show name"));
$stream_format->setValue(Application_Model_Preference::GetStreamLabelFormat());
$stream_format->setDecorators(array('ViewHelper'));
$this->addElement($stream_format);
}
示例2: init
public function init()
{
$this->setMethod('POST');
$this->setName("adminForm");
$element = new Zend_Form_Element_Hidden('id');
$element->setValue($this->advertisement->id);
$this->addElement($element);
$element = new Zend_Form_Element_Hidden('city');
$element->setValue($this->city);
$this->addElement($element);
$element = new Zend_Form_Element_Radio('action');
$element->setMultiOptions(array('0' => '已解决, 关闭帖子', '1' => '打错了些东东, 修改帖子', '2' => '我是管理员, 删除帖子'));
$element->setValue(0);
$this->addElement($element);
$element = new Zend_Form_Element_Text('password');
$element->setLabel('密码');
$element->setDescription('忘记密码?');
$this->addElement($element);
$element = new Elements();
$element->addReCaptcha($this);
$element = new Zend_Form_Element_Submit('post');
$element->setLabel('提交')->removeDecorator('Label');
$this->addElement($element);
$this->addDisplayGroup(array('password', 'captcha', 'post'), 'leftMargin');
$this->getDisplayGroup('leftMargin')->removeDecorator('DtDdWrapper');
}
示例3: init
public function init()
{
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled' ? false : true;
$this->isSaas = $isSaas;
$this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/preferences_general.phtml', "isSaas" => $isSaas))));
$defaultFade = Application_Model_Preference::GetDefaultFade();
if ($defaultFade == "") {
$defaultFade = '0.500000';
}
//Station name
$this->addElement('text', 'stationName', array('class' => 'input_text', 'label' => 'Station Name', 'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetStationName(), 'decorators' => array('ViewHelper')));
//Default station fade
$this->addElement('text', 'stationDefaultFade', array('class' => 'input_text', 'label' => 'Default Fade (s):', 'required' => false, 'filters' => array('StringTrim'), 'validators' => array(array('regex', false, array('/^[0-9]{1,2}(\\.\\d{1,6})?$/', 'messages' => 'enter a time in seconds 0{.000000}'))), 'value' => $defaultFade, 'decorators' => array('ViewHelper')));
$third_party_api = new Zend_Form_Element_Radio('thirdPartyApi');
$third_party_api->setLabel('Allow Remote Websites To Access "Schedule" Info?<br> (Enable this to make front-end widgets work.)');
$third_party_api->setMultiOptions(array("Disabled", "Enabled"));
$third_party_api->setValue(Application_Model_Preference::GetAllow3rdPartyApi());
$third_party_api->setDecorators(array('ViewHelper'));
$this->addElement($third_party_api);
/* Form Element for setting the Timezone */
$timezone = new Zend_Form_Element_Select("timezone");
$timezone->setLabel("Timezone");
$timezone->setMultiOptions($this->getTimezones());
$timezone->setValue(Application_Model_Preference::GetTimezone());
$timezone->setDecorators(array('ViewHelper'));
$this->addElement($timezone);
/* Form Element for setting which day is the start of the week */
$week_start_day = new Zend_Form_Element_Select("weekStartDay");
$week_start_day->setLabel("Week Starts On");
$week_start_day->setMultiOptions($this->getWeekStartDays());
$week_start_day->setValue(Application_Model_Preference::GetWeekStartDay());
$week_start_day->setDecorators(array('ViewHelper'));
$this->addElement($week_start_day);
}
示例4: renderFormElement
public function renderFormElement()
{
$elm = new Zend_Form_Element_Radio($this->getName(), array('label' => $this->getLabel() . ':'));
$elm->setDescription($this->getDescription());
$elm->setMultiOptions($this->_rankingOptions);
$elm->setValue($this->getValue());
$elm->setRequired($this->getRequired());
$elm->setSeparator('');
return $elm;
}
示例5: buildCat1Element
protected function buildCat1Element()
{
$cat1 = new Zend_Form_Element_Radio('cat1');
$cat1->setLabel($this->_business->getCat1Name());
$cat1->setMultiOptions($this->_business->getCat1Array());
//$cat1->setValue($this->_business->getFirstCat1());
logfire('FFFkey', $this->_business->getFirstCat1());
$cat1->setValue($this->_business->getFirstCat1());
$cat1->setAttrib('class', 'refineformselect');
$this->addElement($cat1);
}
示例6: init
public function init()
{
// cliente_tipo
$cliente_tipo = new Zend_Form_Element_Radio("cliente_tipo");
$cliente_tipo->setLabel("Tipo: ");
$cliente_tipo->setRequired();
$cliente_tipo->setDecorators(App_Forms_Decorators::$checkboxElementDecorators);
$cliente_tipo->setMultiOptions(array('PF' => ' Pessoa Física', 'PJ' => ' Pessoa Jurídica'));
// cliente_empresa
$cliente_empresa = new Zend_Form_Element_Text("cliente_empresa");
$cliente_empresa->setLabel("Empresa:");
$cliente_empresa->setAttribs(array('class' => 'form-control'));
// cliente_nome
$cliente_nome = new Zend_Form_Element_Text("cliente_nome");
$cliente_nome->setLabel("Contato:");
$cliente_nome->setRequired();
$cliente_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
$cliente_nome->setAttribs(array('class' => 'form-control'));
// cliente_email
$cliente_email = new Zend_Form_Element_Text("cliente_email");
$cliente_email->setLabel("E-mail:");
$cliente_email->setRequired();
$cliente_email->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
$cliente_email->setAttribs(array('class' => 'form-control'));
// cliente_telefone
$cliente_telefone = new Zend_Form_Element_Text("cliente_telefone");
$cliente_telefone->setLabel("Telefone:");
$cliente_telefone->setAttribs(array('class' => 'form-control'));
// cliente_celular
$cliente_celular = new Zend_Form_Element_Text("cliente_celular");
$cliente_celular->setLabel("Celular:");
$cliente_celular->setAttribs(array('class' => 'form-control'));
// cliente_cidade
$cliente_cidade = new Zend_Form_Element_Text("cliente_cidade");
$cliente_cidade->setLabel("Cidade:");
$cliente_cidade->setAttribs(array('class' => 'form-control'));
// cliente_estado
$cliente_estado = new Zend_Form_Element_Select("cliente_estado");
$cliente_estado->setLabel("Estado:");
$cliente_estado->setAttribs(array('class' => 'form-control'));
$cliente_estado->setMultiOptions($this->getEstados());
/**
* Add elements
*/
$this->addElements(array($cliente_tipo, $cliente_empresa, $cliente_nome, $cliente_email, $cliente_telefone, $cliente_celular, $cliente_cidade, $cliente_estado));
parent::init();
}
示例7: init
public function init()
{
// profissional_beleza_nome
$profissional_beleza_nome = new Zend_Form_Element_Text("profissional_beleza_nome");
$profissional_beleza_nome->setLabel("Nome: ");
$profissional_beleza_nome->setAttribs(array('class' => 'form-control'));
$profissional_beleza_nome->setRequired();
$profissional_beleza_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
// profissional_beleza_email
$profissional_beleza_email = new Zend_Form_Element_Text("profissional_beleza_email");
$profissional_beleza_email->setLabel("E-mail: ");
$profissional_beleza_email->setValidators(array('EmailAddress'));
$profissional_beleza_email->addValidator(new App_Validate_ProfissionalBeleza());
$profissional_beleza_email->setAttribs(array('class' => 'form-control'));
$profissional_beleza_email->setRequired();
$profissional_beleza_email->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
/**
* profisional_beleza_sexo
*/
$profissional_beleza_sexo = new Zend_Form_Element_Radio("profissional_beleza_sexo");
$profissional_beleza_sexo->setLabel("Sexo:");
$profissional_beleza_sexo->setRequired();
$profissional_beleza_sexo->setDecorators(App_Forms_Decorators::$checkboxElementDecorators);
$profissional_beleza_sexo->setMultiOptions(array('M' => ' Masculino', 'F' => ' Feminino'));
// profissional_beleza_avatar
$profissional_beleza_avatar = new Zend_Form_Element_File("profissional_beleza_avatar");
$profissional_beleza_avatar->setLabel(" \n Foto: \n ");
$profissional_beleza_avatar->addDecorators(App_Forms_Decorators::$ElementDecoratorFile);
$profissional_beleza_avatar->setAttribs(array('class' => 'filestyle', 'data-buttonText' => 'Selecione a foto', 'data-iconName' => 'fa fa-user'));
$profissional_beleza_avatar->setRequired();
$profissional_beleza_avatar->setDestination(Zend_Registry::get('config')->profissional->avatar->path);
$profissional_beleza_avatar->addValidators(array(array('Extension', false, 'jpg,jpeg,png')));
$profissional_beleza_avatar->addFilter(new Skoch_Filter_File_Resize(array('width' => 160, 'keepRatio' => true)));
// especialidade_id
$especialidade_id = new Zend_Form_Element_MultiCheckbox("especialidade_id");
$especialidade_id->setLabel("Selecione as especialidades: ");
$especialidade_id->setAttribs(array('class' => ''));
$especialidade_id->setRequired();
$especialidade_id->setDecorators(App_Forms_Decorators::$checkboxElementDecorators);
$especialidade_id->setSeparator(' ');
$especialidade_id->setMultiOptions($this->getEspecialidades());
// addElements
$this->addElements(array($profissional_beleza_nome, $profissional_beleza_email, $profissional_beleza_sexo, $profissional_beleza_avatar, $especialidade_id));
parent::init();
}
示例8: init
public function init()
{
$notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator();
$rangeValidator = Application_Form_Helper_ValidationTypes::overrideBetweenValidator(0, 59.9);
$this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/preferences_general.phtml'))));
$defaultFadeIn = Application_Model_Preference::GetDefaultFadeIn();
$defaultFadeOut = Application_Model_Preference::GetDefaultFadeOut();
//Station name
$this->addElement('text', 'stationName', array('class' => 'input_text', 'label' => _('Station Name'), 'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetStationName(), 'decorators' => array('ViewHelper')));
//Default station fade in
$this->addElement('text', 'stationDefaultCrossfadeDuration', array('class' => 'input_text', 'label' => _('Default Crossfade Duration (s):'), 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array($rangeValidator, $notEmptyValidator, 'regex', false, array('/^[0-9]{1,2}(\\.\\d{1})?$/', 'messages' => _('enter a time in seconds 0{.0}')))), 'value' => Application_Model_Preference::GetDefaultCrossfadeDuration(), 'decorators' => array('ViewHelper')));
//Default station fade in
$this->addElement('text', 'stationDefaultFadeIn', array('class' => 'input_text', 'label' => _('Default Fade In (s):'), 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array($rangeValidator, $notEmptyValidator, 'regex', false, array('/^[0-9]{1,2}(\\.\\d{1})?$/', 'messages' => _('enter a time in seconds 0{.0}')))), 'value' => $defaultFadeIn, 'decorators' => array('ViewHelper')));
//Default station fade out
$this->addElement('text', 'stationDefaultFadeOut', array('class' => 'input_text', 'label' => _('Default Fade Out (s):'), 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array($rangeValidator, $notEmptyValidator, 'regex', false, array('/^[0-9]{1,2}(\\.\\d{1})?$/', 'messages' => _('enter a time in seconds 0{.0}')))), 'value' => $defaultFadeOut, 'decorators' => array('ViewHelper')));
$third_party_api = new Zend_Form_Element_Radio('thirdPartyApi');
$third_party_api->setLabel(sprintf(_('Allow Remote Websites To Access "Schedule" Info?%s (Enable this to make front-end widgets work.)'), '<br>'));
$third_party_api->setMultiOptions(array(_("Disabled"), _("Enabled")));
$third_party_api->setValue(Application_Model_Preference::GetAllow3rdPartyApi());
$third_party_api->setDecorators(array('ViewHelper'));
$this->addElement($third_party_api);
$locale = new Zend_Form_Element_Select("locale");
$locale->setLabel(_("Default Interface Language"));
$locale->setMultiOptions(Application_Model_Locale::getLocales());
$locale->setValue(Application_Model_Preference::GetDefaultLocale());
$locale->setDecorators(array('ViewHelper'));
$this->addElement($locale);
/* Form Element for setting the Timezone */
$timezone = new Zend_Form_Element_Select("timezone");
$timezone->setLabel(_("Station Timezone"));
$timezone->setMultiOptions(Application_Common_Timezone::getTimezones());
$timezone->setValue(Application_Model_Preference::GetDefaultTimezone());
$timezone->setDecorators(array('ViewHelper'));
$this->addElement($timezone);
/* Form Element for setting which day is the start of the week */
$week_start_day = new Zend_Form_Element_Select("weekStartDay");
$week_start_day->setLabel(_("Week Starts On"));
$week_start_day->setMultiOptions($this->getWeekStartDays());
$week_start_day->setValue(Application_Model_Preference::GetWeekStartDay());
$week_start_day->setDecorators(array('ViewHelper'));
$this->addElement($week_start_day);
}
示例9: init
public function init()
{
$oServerCron = new \Zend_Form_Element_Radio('radioServerCron');
$oServerCron->setLabel('Select cronjob handler');
$oServerCron->setMultiOptions(array('true' => 'Server', 'false' => 'WP cron'));
$oEmail = new \Zend_Form_Element_Text('textEmail');
$oEmail->setLabel('Debug email');
$oSubmit = new \Zend_Form_Element_Button('submitSubmit');
$oSubmit->setLabel('Submit')->setAttrib('type', 'submit')->setDecorators(array('ViewHelper'));
switch ($this->_sContext) {
case self::CONTEXT_CREATE:
$oSubmit->setLabel('<i class="icon icon-save"></i> Save')->setAttrib('escape', false)->setAttrib('class', 'btn btn-success');
$aCreateElements = array($oServerCron, $oEmail, $oSubmit);
$this->addElements($aCreateElements);
break;
}
$this->_sViewScript = '/forms/settings.phtml';
// $this->_sViewScript = '/forms/generic_two_column.phtml';
$this->setDecorators(array(array('ViewScript', array('viewScript' => $this->_sViewScript))));
}
示例10: startFrom
public function startFrom()
{
$setting = $this->setting;
if (Application_Model_Preference::GetPlanLevel() == 'disabled') {
$output_sound_device = new Zend_Form_Element_Checkbox('output_sound_device');
$output_sound_device->setLabel(_('Hardware Audio Output'))->setRequired(false)->setValue($setting['output_sound_device'] == "true" ? 1 : 0)->setDecorators(array('ViewHelper'));
if (Application_Model_Preference::GetEnableStreamConf() == "false") {
$output_sound_device->setAttrib("readonly", true);
}
$this->addElement($output_sound_device);
$output_types = array("ALSA" => "ALSA", "AO" => "AO", "OSS" => "OSS", "Portaudio" => "Portaudio", "Pulseaudio" => "Pulseaudio");
$output_type = new Zend_Form_Element_Select('output_sound_device_type');
$output_type->setLabel(_("Output Type"))->setMultiOptions($output_types)->setValue($setting['output_sound_device_type'])->setDecorators(array('ViewHelper'));
if ($setting['output_sound_device'] != "true") {
$output_type->setAttrib("disabled", "disabled");
}
$this->addElement($output_type);
}
$icecast_vorbis_metadata = new Zend_Form_Element_Checkbox('icecast_vorbis_metadata');
$icecast_vorbis_metadata->setLabel(_('Icecast Vorbis Metadata'))->setRequired(false)->setValue($setting['icecast_vorbis_metadata'] == "true" ? 1 : 0)->setDecorators(array('ViewHelper'));
if (Application_Model_Preference::GetEnableStreamConf() == "false") {
$icecast_vorbis_metadata->setAttrib("readonly", true);
}
$this->addElement($icecast_vorbis_metadata);
$stream_format = new Zend_Form_Element_Radio('streamFormat');
$stream_format->setLabel(_('Stream Label:'));
$stream_format->setMultiOptions(array(_("Artist - Title"), _("Show - Artist - Title"), _("Station name - Show name")));
$stream_format->setValue(Application_Model_Preference::GetStreamLabelFormat());
$stream_format->setDecorators(array('ViewHelper'));
$this->addElement($stream_format);
$offAirMeta = new Zend_Form_Element_Text('offAirMeta');
$offAirMeta->setLabel(_('Off Air Metadata'))->setValue(Application_Model_StreamSetting::getOffAirMeta())->setDecorators(array('ViewHelper'));
$this->addElement($offAirMeta);
$enable_replay_gain = new Zend_Form_Element_Checkbox("enableReplayGain");
$enable_replay_gain->setLabel(_("Enable Replay Gain"))->setValue(Application_Model_Preference::GetEnableReplayGain())->setDecorators(array('ViewHelper'));
$this->addElement($enable_replay_gain);
$replay_gain = new Zend_Form_Element_Hidden("replayGainModifier");
$replay_gain->setLabel(_("Replay Gain Modifier"))->setValue(Application_Model_Preference::getReplayGainModifier())->setAttribs(array('style' => "border: 0; color: #f6931f; font-weight: bold;"))->setDecorators(array('ViewHelper'));
$this->addElement($replay_gain);
}
示例11: init
public function init()
{
$this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/preferences_general.phtml'))));
$defaultFade = Application_Model_Preference::GetDefaultFade();
if ($defaultFade == "") {
$defaultFade = '00:00:00.000000';
}
//Station name
$this->addElement('text', 'stationName', array('class' => 'input_text', 'label' => 'Station Name', 'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetValue("station_name"), 'decorators' => array('ViewHelper')));
//Default station fade
$this->addElement('text', 'stationDefaultFade', array('class' => 'input_text', 'label' => 'Default Fade:', 'required' => false, 'filters' => array('StringTrim'), 'validators' => array(array('regex', false, array('/^[0-2][0-3]:[0-5][0-9]:[0-5][0-9](\\.\\d{1,6})?$/', 'messages' => 'enter a time 00:00:00{.000000}'))), 'value' => $defaultFade, 'decorators' => array('ViewHelper')));
$stream_format = new Zend_Form_Element_Radio('streamFormat');
$stream_format->setLabel('Stream Label:');
$stream_format->setMultiOptions(array("Artist - Title", "Show - Artist - Title", "Station name - Show name"));
$stream_format->setValue(Application_Model_Preference::GetStreamLabelFormat());
$stream_format->setDecorators(array('ViewHelper'));
$this->addElement($stream_format);
$third_party_api = new Zend_Form_Element_Radio('thirdPartyApi');
$third_party_api->setLabel('Allow Remote Websites To Access "Schedule" Info?<br> (Enable this to make front-end widgets work.)');
$third_party_api->setMultiOptions(array("Disabled", "Enabled"));
$third_party_api->setValue(Application_Model_Preference::GetAllow3rdPartyApi());
$third_party_api->setDecorators(array('ViewHelper'));
$this->addElement($third_party_api);
}
示例12: init
public function init()
{
$this->setMethod('post')->setAttrib('id', 'frmTest')->setAttrib('enctype', 'multipart/form-data');
// Elemento: Nombre
$e = new Zend_Form_Element_Text('nombre');
$e->setLabel('Nombre');
$e->setFilters(array('StringToLower'));
$this->addElement($e);
// Elemento: activo
$e = new Zend_Form_Element_Checkbox('activo');
$e->setLabel('Activo');
$this->addElement($e);
// Elemento: activo2
$e = new Zend_Form_Element_Radio('activo2');
$e->setLabel('Activo2');
$_cat = new Application_Model_Categoria();
$values = $_cat->getComboValues();
$e->setMultiOptions($values);
$e->setValue(array_rand($values));
$v = new Zend_Validate_InArray(array_keys($values));
$this->addElement($e);
$e = new Zend_Form_Element_File('imagen');
$e->setLabel('Upload an image:');
$e->setDestination(APPLICATION_PATH . '/../public/uploads/');
$f = new Zend_Filter_File_Rename(array('target' => '123.jpg'));
// Renombrar archivo
$e->addFilter($f);
$e->addValidator('Count', false, 1);
// Solo 1 archivo
$e->addValidator('Size', false, 102400);
// limite de 100K
$e->addValidator('Extension', false, 'jpg,png,gif');
// solo JPEG, PNG, and GIFs
$this->addElement($e);
$this->addElement('submit', 'Enviar');
}
示例13: init
public function init()
{
$this->setAttribs(array('id' => 'formSiteCadastro'));
// empresa_tipo
$empresa_tipo = new Zend_Form_Element_Radio("empresa_tipo");
$empresa_tipo->setLabel("Tipo: ");
$empresa_tipo->setMultiOptions(array(1 => ' Pessoa Física', 2 => ' Pessoa Jurídica'));
$empresa_tipo->setRequired();
// empresa_cpf_cnpj
$empresa_cpf_cnpj = new Zend_Form_Element_Text("empresa_cpf_cnpj");
$empresa_cpf_cnpj->setLabel("CPF/CNPJ: ");
$empresa_cpf_cnpj->setAttribs(array('class' => 'form-control'));
// empresa_nome
$empresa_nome = new Zend_Form_Element_Text("empresa_nome");
$empresa_nome->setLabel("Empresa: ");
$empresa_nome->setAttribs(array('class' => 'form-control'));
// empresa_responsavel
$empresa_responsavel = new Zend_Form_Element_Text("empresa_responsavel");
$empresa_responsavel->setLabel("Responsável: ");
$empresa_responsavel->setAttribs(array('class' => 'form-control'));
// empresa_email
$empresa_email = new Zend_Form_Element_Text("empresa_email");
$empresa_email->setLabel("E-mail: ");
$empresa_email->setAttribs(array('class' => 'form-control'));
// empresa_telefone
$empresa_telefone = new Zend_Form_Element_Text("empresa_telefone");
$empresa_telefone->setLabel("Telefone: ");
$empresa_telefone->setAttribs(array('class' => 'form-control'));
// empresa_celular
$empresa_celular = new Zend_Form_Element_Text("empresa_celular");
$empresa_celular->setLabel("Celular: ");
$empresa_celular->setAttribs(array('class' => 'form-control'));
// empresa_endereco
$empresa_endereco = new Zend_Form_Element_Text("empresa_endereco");
$empresa_endereco->setLabel("Endereco: ");
$empresa_endereco->setAttribs(array('class' => 'form-control'));
// empresa_numero
$empresa_numero = new Zend_Form_Element_Text("empresa_numero");
$empresa_numero->setLabel("Número: ");
$empresa_numero->setAttribs(array('class' => 'form-control'));
// empresa_complemento
$empresa_complemento = new Zend_Form_Element_Text("empresa_complemento");
$empresa_complemento->setLabel("Compelmento: ");
$empresa_complemento->setAttribs(array('class' => 'form-control'));
// empresa_bairro
$empresa_bairro = new Zend_Form_Element_Text("empresa_bairro");
$empresa_bairro->setLabel("Bairro: ");
$empresa_bairro->setAttribs(array('class' => 'form-control'));
// empresa_cidade
// empresa_estado
// empresa_servico
$empresa_servico = new Zend_Form_Element_Text("empresa_servico");
$empresa_servico->setLabel("Cadastre os serviços que oferece:");
$empresa_servico->isArray(true);
$empresa_servico->setAttribs(array('class' => 'form-control'));
// submit
$submit = new Zend_Form_Element_Submit("submit");
$submit->setAttrib("class", 'btn btn-default');
$submit->setLabel("Cadastrar");
$this->addElements(array($empresa_tipo, $empresa_cpf_cnpj, $empresa_nome, $empresa_responsavel, $empresa_email, $empresa_endereco, $empresa_numero, $empresa_complemento, $empresa_bairro, $empresa_telefone, $empresa_celular, $empresa_servico, $submit));
}
示例14: AddProductForm
public function AddProductForm($data = null)
{
$tr = Application_Form_FrmLanguages::getCurrentlanguage();
$user_info = new Application_Model_DbTable_DbGetUserInfo();
$result = $user_info->getUserInfo();
$db = new Application_Model_DbTable_DbGlobal();
$tr = Application_Form_FrmLanguages::getCurrentlanguage();
$nameElement = new Zend_Form_Element_Text('txt_name');
$nameElement->setAttribs(array('class' => 'validate[required]', 'placeholder' => $tr->translate('ENTER_ITEM')));
$this->addElement($nameElement);
$product_size = new Zend_Form_Element_Text('product_size');
$product_size->setAttribs(array('placeholder' => $tr->translate('ENTER_ITME_SIZE')));
$this->addElement($product_size);
$codeElement = new Zend_Form_Element_Text('txt_code');
$codeElement->setAttribs(array('placeholder' => $tr->translate("ENTER_ITEM_CODE"), 'class' => 'validate[required]', 'Onblur' => 'CheckPCode()'));
$this->addElement($codeElement);
$rowsBranch = $db->getGlobalDb('SELECT CategoryId, Name FROM tb_category WHERE Name!="" AND IsActive=1 ORDER BY CategoryId DESC ');
$options = "";
if ($result["level"] == 1 or $result["level"] == 2) {
$options = array("" => $tr->translate("SELECT_CATEGORY"), "-1" => $tr->translate("ADD_NEW"));
}
if ($rowsBranch) {
foreach ($rowsBranch as $readCategory) {
$options[$readCategory['CategoryId']] = $readCategory['Name'];
}
}
$categoryElement = new Zend_Form_Element_Select('category');
$categoryElement->setAttribs(array('class' => 'validate[required]', "Onchange" => "showPopupCategory()"));
$categoryElement->setMultiOptions($options);
$this->addElement($categoryElement);
$rowsBranch = $db->getGlobalDb('SELECT branch_id, Name FROM tb_branch WHERE Name!="" AND IsActive=1 ORDER BY Name DESC ');
$options = "";
if ($result["level"] == 1 or $result["level"] == 2) {
$options = array("" => $tr->translate("SELECT_BRAND"), "-1" => $tr->translate("ADD_NEW"));
}
if ($rowsBranch) {
foreach ($rowsBranch as $readBranch) {
$options[$readBranch['branch_id']] = $readBranch['Name'];
}
}
$branchElement = new Zend_Form_Element_Select('branch_id');
$branchElement->setAttribs(array('class' => 'validate[required]', "Onchange" => "showPopupBranch()"));
$branchElement->setMultiOptions($options);
$this->addElement($branchElement);
$typeElement = new Zend_Form_Element_Select('stock_type');
$typeElement->setAttribs(array('id' => 'single'));
$typeElement->setMultiOptions(array(1 => $tr->translate("STOCKABLE"), 2 => $tr->translate("NON_STOCKED"), 3 => $tr->translate("SERVICE")));
$this->addElement($typeElement);
$rowsmeasures = $db->getGlobalDb("SELECT id,measure_name FROM `tb_measure` WHERE measure_name!='' AND public =1");
$options = array("" => $tr->translate("SELECT_MEASURE"), "-1" => $tr->translate("ADD_NEW"));
if ($rowsmeasures) {
foreach ($rowsmeasures as $readmeasure) {
$options[$readmeasure['id']] = $readmeasure['measure_name'];
}
}
$measure_unit = new Zend_Form_Element_Select('measure_unit');
$measure_unit->setMultiOptions($options);
$measure_unit->setAttribs(array('class' => 'validate[required]', "Onchange" => "showPopupMeasure()"));
$measure_unit->setMultiOptions($options);
$this->addElement($measure_unit);
$uom = new Zend_Form_Element_Text('uom');
//uom = unit of measure
$uom->setAttribs(array('class' => 'validate[custom[number]', "style" => "width:initial;", "size" => "4", 'readonly' => 'readonly'));
$uom->setValue(1);
$this->addElement($uom);
$qty_perunit = new Zend_Form_Element_Text('qty_perunit');
//uom = unit of measure
$qty_perunit->setAttribs(array('class' => 'validate[required[custom[number]]]', 'placeholder' => $tr->translate("QTY_PERUNIT"), "style" => "width:initial;", "size" => "4"));
$this->addElement($qty_perunit);
$label_perunit = new Zend_Form_Element_Text('label_perunit');
//uom = unit of measure
$label_perunit->setAttribs(array('class' => 'validate[required]', 'placeholder' => $tr->translate("LABEL_UNIT"), "style" => "width:initial;", "size" => "10"));
$this->addElement($label_perunit);
$itemImageElement = new Zend_Form_Element_File('photo');
$this->addElement($itemImageElement);
// $costingMethodElement = new Zend_Form_Element_Select('costingmethod');
// $costingMethodElement->setMultiOptions(array(1=>$tr->translate("Manual"), 2=>$tr->translate("Moving Average"),3=>$tr->translate("Last Purchase")));
// $this->addElement($costingMethodElement);
$remarkElement = new Zend_Form_Element_Textarea('remark');
$this->addElement($remarkElement);
$status = new Zend_Form_Element_Radio('status');
$status->setMultiOptions(array(1 => $tr->translate("ALL"), 2 => $tr->translate("IS_PURCHASE"), 3 => $tr->translate("IS_SALES"), 4 => $tr->translate("ALL_NONE")));
$status->setValue(1);
$this->addElement($status);
$rssetting = $db->getSetting();
$unit_sale_price = new Zend_Form_Element_Text('unit_sale_price');
if ($rssetting[0]['key_value'] == 1) {
//if set default salse price
$unit_sale_price = new Zend_Form_Element_Text('unit_sale_price');
$unit_sale_price->setLabel("Unit Sale Price");
$unit_sale_price->setAttribs(array('class' => 'validate[required[custom[number]]]'));
} else {
$unit_sale_price = new Zend_Form_Element_Hidden('unit_sale_price');
$unit_sale_price->setLabel("");
}
$this->addElement($unit_sale_price);
//echo $rs['key_valu'];
if (!$data == null) {
$idElement = new Zend_Form_Element_Hidden('id');
$this->addElement($idElement);
//.........这里部分代码省略.........
示例15: testRenderWithListSeparatorForRadio
/**
* @group ZF-9689
*/
public function testRenderWithListSeparatorForRadio()
{
require_once 'Zend/Form/Element/Radio.php';
$element = new Zend_Form_Element_Radio('foo');
$options = array('foo' => 'Foo', 'bar' => 'Bar');
$element->setMultiOptions($options);
$element->setSeparator('</p><p>');
$element->setDecorators(array(array('ViewHelper', array('separator' => '')), array('HtmlTag', array('tag' => 'p'))));
$expected = '<p><label><input type="radio" name="foo" id="foo-foo" value="foo">Foo</label></p>' . '<p><label><input type="radio" name="foo" id="foo-bar" value="bar">Bar</label></p>';
$actual = $element->render($this->getView());
$this->assertEquals($expected, $actual);
}