Я пытаюсь получить следующий макет с помощью декораторов:
<form action="/index/login" method="post" id="login_form"> <div class="input_row"> <img src="/images/user_icon.png" class="login_icon" alt=""/> <label for="username" class="login_label">Username:</label> <input type="text" name="username" value="" id="username" class="login_input" /> </div> <div class="input_row"> <img src="/images/password_icon.png" class="login_icon" alt=""/> <label for="password" class="login_label">Password:</label> <input type="password" name="password" value="" id="password" class="login_input" /> </div> <div class="input_row"> <input type="submit" name="login_submit" value="Login" class="login_submit" /> </div> </form>
У меня это до сих пор:
$form = new Zend_Form; $form->setAction('/index/login') ->setMethod('post') ->setAttrib('id', 'login_form'); $username = $form->createElement('text', 'username'); $username->addValidator('alnum') ->setRequired(TRUE) ->setLabel('Username') ->setAttrib('class', 'login_input'); $username->setDecorators(array( 'ViewHelper', 'Errors', array('Label',array('class' => 'login_label')), array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'input_row') )); $form->addElement($username) ->addElement('submit', 'login', array('label' => 'Login'));
,$form = new Zend_Form; $form->setAction('/index/login') ->setMethod('post') ->setAttrib('id', 'login_form'); $username = $form->createElement('text', 'username'); $username->addValidator('alnum') ->setRequired(TRUE) ->setLabel('Username') ->setAttrib('class', 'login_input'); $username->setDecorators(array( 'ViewHelper', 'Errors', array('Label',array('class' => 'login_label')), array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'input_row') )); $form->addElement($username) ->addElement('submit', 'login', array('label' => 'Login'));
Как разместить ярлык над меткой?
Благодаря!