views:

207

answers:

1

I have a little problem, I want to have the link inside the DIV instead before. I want to have it look like:

<div class="clear">
  <a href="somelink">A link</a>
  <input type="submit" name="submit" id="submit" value="submit" />
</div>

But at the moment it looks like that:

<a href="somelink">A link</a>
<div class="clear">
  <input type="submit" name="submit" id="submit" value="submit" />
</div>

PHP:

$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('submit')
       ->setDisableLoadDefaultDecorators(true)
       ->setDecorators(array(
           'ViewHelper',
           array('HtmlTag', array('tag' => 'div', 'class' => 'clear')),
           array('Description', array('escape' => false, 'tag' => false, 'placement' => 'prepend'))
       ))
       ->setDescription('<a href="somelink">A link</a>');
A: 

The best way is write your own, custom decorator. AnyMarkup decorator may be helpful.

You may be interested in this article about decorators. There is also nice Matthew's screencast about decorators on Zend Framework page.

takeshin