【问题标题】:Zend Framework. Add elements in form in a single rowZend 框架。在单行中添加表单元素
【发布时间】:2015-04-21 03:07:49
【问题描述】:

我正在开发 Zend Framework 1.2

我有问题。我会在同一行创建一个表单,但使用我的实际代码:

$this->addElement('select', 'prod_name', array(
'required'   => true,
'multioptions'=> $portales,
           'label'      => 'Portales Suscritos:',
'style' => 'display: inline;'
       ));

$this->addElement('submit', 'submit1', array(
           'ignore'   => true,
           'label'    => 'Cambiar',
'style' => 'display: inline;'
       ));

它显示为两行。一行带有标签“Portales Suscritos:”和选择器,然后是第二行带有一个空格和按钮的提交

我希望它显示在一行中

有什么想法吗??谢谢!!!

【问题讨论】:

    标签: php html css zend-framework zend-form


    【解决方案1】:

    我的建议是使用 Form Decorators 像您的格式一样显示表单。您也可以创建自己的自定义装饰器来显示表单。您没有使用任何 table或 div 格式。这样您就可以显示任何您喜欢的形式。

    这里我给出了自定义装饰器的例子。

    $_FormElementDecorators =  array(
    
                       'ViewHelper',
    
                       'Description',
    
                       'Errors',
    
                       array(array('data'=>'HtmlTag'), array('tag' => 'td','style'=>'class_name')),
    
                       array('Label', array('tag' => 'td', 'class'=>'labelcolor'))
    
    
               );
    

    有关 Zend 表单装饰器的更多信息,请查看此链接 http://framework.zend.com/manual/1.12/en/learning.form.decorators.html

    谢谢

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-08-26
      • 1970-01-01
      • 2011-04-20
      • 2013-07-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多