« Return to Thread: valid html issue

Re: valid html issue

by weierophinney :: Rate this Message:

Reply to Author | View in Thread

-- Greg Donald <gdonald@...> wrote
(on Wednesday, 28 May 2008, 10:13 PM -0500):

> I'm using
>
> <?php echo $this->doctype( 'XHTML1_STRICT' ); ?>
>
> in my layout.  Then I'm creating a form like this:
>
> $form = new Zend_Form;
> $form->setAction( '/user/signup' )->setMethod( 'post' );
> $form->addElement( new Zend_Form_Element_Text( 'username' ) );
>
> which creates an input field that's missing the closing slash near the end:
>
> <input type="text" name="username" id="username" value="">
>
> Is there anything else I'm supposed to do to get valid html?

This has been covered a number of times. You need to set the doctype in
your bootstrap or an early-running plugin so that it can be used in your
action view scripts; when you set it in the layout, it's too late, as
these have already been rendered.

There's an issue already posted to update the documentation to note
this.

--
Matthew Weier O'Phinney
Software Architect       | matthew@...
Zend - The PHP Company   | http://www.zend.com/

 « Return to Thread: valid html issue