【问题标题】:How to append or Prepending HTML Tags to SocialEngine Form Element?如何在 SocialEngine 表单元素中添加或添加 HTML 标签?
【发布时间】:2017-02-21 05:47:21
【问题描述】:

我想要一个 html 表单,我可以在其中对 div 中的一些元素进行分组。我正在使用社交引擎创建表单?

【问题讨论】:

    标签: html forms zend-framework socialengine


    【解决方案1】:

    经过长时间的研究,我得到了这个解决方案,它可能对其他人有帮助。

    class Mymodule_Form_Article_Filter extends Engine_Form{
    
    public function init()
    {
        $request = Zend_Controller_Front::getInstance()->getRequest();
    
        $this->setDescription('Find article which you want..');
        $this->setAttrib('class', 'global_form_popup');
    
        //create a form element
        $this->addElement('Text', 'outcome', array(
            'label' => 'Search Outcome',
            'required' => false,
            'value' =>$request->getParam('outcome'),
            'class' => 'outcome-search'
        ));
        // create submit element
        $this->addElement('Button', 'submit', array(
            'label' => 'Filter Articles',
            'type' => 'submit',
            'class' => 'outcome-search'
        ));
        //wrapping to a div
        $this->addDisplayGroup(array('outcome', 'submit'), 'searchGroup');
        $group = $this->getDisplayGroup('searchGroup');
    
        $group->setDecorators(array(
            'FormElements',
            array('HtmlTag', array('tag' => 'div', 'class' => 'full-length-search'))
        ));
    
        }
    }
    

    【讨论】:

      猜你喜欢
      • 2011-04-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多