Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/265.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 无法在Zend Framework中获取doctype的输出_Php_Zend Framework - Fatal编程技术网

Php 无法在Zend Framework中获取doctype的输出

Php 无法在Zend Framework中获取doctype的输出,php,zend-framework,Php,Zend Framework,在我的引导程序中,我有这个代码 $view = new Zend_View(); $view->setEncoding('UTF-8'); $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view); Zend_Controller_Action_HelperBroker::addHelper($viewRenderer); $viewRenderer->initV

在我的引导程序中,我有这个代码

    $view = new Zend_View();
    $view->setEncoding('UTF-8');
    $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view);
    Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
    $viewRenderer->initView();
    $viewRenderer->view->doctype('XHTML1_TRANSITIONAL');
    Zend_Layout::startMvc(
                    array(
                        'layoutPath' => dirname(__FILE__) . '/layouts/scripts/'
                    )
    );
在我的layout.phtml中

<?php echo $this->doctype(); ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php $this->headTitle()->append('Site Title'); ?>
<?php echo $this->headTitle(); ?>
</head>
<body>
<div class="dp100">
<?php
echo $this->layout()->content;
?>
</div>
</body>
</html>


不过,我在最后的HTML页面中没有看到预期的doctype声明。Duh!我在Firebug中检查我的源代码,它实际上隐藏了DOCTYPE声明,因为它没有首先在HTML文档中得到响应。在回显doctype之前,我回显了jquery include语句

通过检查Firefox中的实际源代码找到了解决方案