public function setDocType($docType)
{
$docType = str_replace(' ', '', strtolower($docType));
if ($docType == 'xhtml1.1' || $docType == 'xhtml') {
return;
//XHTML 1.1 is the default
} else {
if ($docType == 'xhtml1.0') {
$docType = 'strict';
}
}
$docType = str_replace(array('xhtml mobile', 'xhtml1.0'), array('mobile', ''), $docType);
$docTypes = array('mobile1.2' => '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" ' . '"http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">', 'mobile1.1' => '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.1//EN ' . '"http://www.openmobilealliance.org/tech/DTD/xhtml-mobile11.dtd">', 'mobile1.0' => '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" ' . '"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">', 'strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ' . '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">', 'transitional' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ' . '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">', 'frameset' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" ' . '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">', 'html4.01' => '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" ' . '"http://www.w3.org/TR/html4/strict.dtd">', 'html5' => '<!DOCTYPE html>');
$docTypes['mobile'] = $docTypes['mobile1.2'];
$docTypes['html'] = $docTypes['html4.01'];
$this->_docType = isset($docTypes[$docType]) ? $docTypes[$docType] : $docType;
}