views:

43

answers:

2

I use xhtml1-strict.dtd and validator.w3.org not validate Zend Forms.
Tell me how you can validate Zend's html

use $view->doctype('XHTML1_STRICT');, but is work only for FormText View Helper :/

example
Zend output: <input type="">
I need: <input type="" />

A: 

You need to set the doctype from within zf. Get the view helper and modify it, like $this->view->doctype('XHTML1_STRICT') in an controller. You should add it to your application.ini if it's a newe version of zf. Check the manual for correct syntax.

chelmertz
it work for Form View Helper. How use it for Zend_Form?
vitaly.batonov
@vitaly check Zendcasts.com for zend framework tuts
tawfekov
A: 

In application.ini:

resources.view.doctype = "XHTML1_STRICT"
resources.layout[]

In your view/scripts/layout.phtml

<?php echo $this->view->doctype(); ?>

In your view/scripts/index/form.phtml

<?php echo $this->form; ?>

takeshin