【问题标题】:@ZEND: How to make form label and element horizontally without decorators@ZEND:如何在没有装饰器的情况下水平制作表单标签和元素
【发布时间】:2013-02-28 07:44:15
【问题描述】:

如何在没有装饰器帮助的情况下水平创建表单元素和标签。

// Add the comment element
        $this->addElement('text', 'txt_password', array(
            'label'      => 'Password:',
            'required'   => true,
            'validators' => array(
                array('validator' => 'StringLength', 'options' => array(0, 20))
                )

        ));

【问题讨论】:

  • 只需将类赋予相应的元素和样式。

标签: php zend-framework zend-form


【解决方案1】:

托盘

$this->addElement('text', 'txt_password', array(

        'label'      => 'Password:',
        'required'   => true,
        'decorators' => array(
            'ViewHelper',
            'Description',
            'Errors',
            array(array('elementDiv' => 'HtmlTag'), array('tag' => 'span')),
            array('Label', array('tag' => 'span')),
         ),
        'validators' => array(
            array('validator' => 'StringLength', 'options' => array(0, 20))
            )

    ));

【讨论】:

    猜你喜欢
    • 2010-11-02
    • 1970-01-01
    • 1970-01-01
    • 2015-05-20
    • 2013-07-25
    • 1970-01-01
    • 2012-03-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多