1

I have a zend form with some element on, including a check box. It looks normal :

checkbox label []

I would like to add a link to the right making it look like this:

checkbox label [] thelink

I've tried the following, but instead of aligning horizontaly the description with the checkbox it puts it under it :

$boolean->setDescription('desc');
        $boolean->setDecorators(array(
            'ViewHelper',
            'Description',
            'Errors',
            array('HtmlTag', array('tag' => 'dd')),
            array('Label', array('tag' => 'dt')),
        ));

I'm a begginer with Zend Forms. Any idea how could i implement this?

Thank you

2
  • I think you might need a decorator. Have a look at the accepted answer of this SO question, I think it might point you in the right direction. Commented Dec 19, 2012 at 13:27
  • Try changing the styles(width, float, etc.) of the dd tag. $element->getDecorator('HtmlTag')->setOption('style', 'width:20px;'); Commented Dec 19, 2012 at 14:34

1 Answer 1

2

Got it!

Here's how i did it:

  $boolean->setDescription('description');
        $boolean->setDecorators(array(
            'ViewHelper',
            'Description',
            'Errors',
            array('HtmlTag', array('tag' => 'dd')),
            array('Label', array('tag' => 'dt')),
            array('Description', array('escape' => false, 'tag' => '', 'placement' => 'append')),
        ));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.