只用了zf访问出现空白页面?
--------------------------------------------------
index.php
--------------------------------------------------
setfallbackautoloader(true);
$registry = zend_registry::getinstance();
$view = new zend_view();
$view->setscriptpath('./application/views/scripts');
$registry['view'] = $view;
$frontcontroller = zend_controller_front::getinstance();
$frontcontroller->setbaseurl('/')
->setparam('noviewrenderer',true)
->setcontrollerdirectory('./application/controllers')
->throwexceptions(true)
->dispatch();
?>
-------------------------------------------------
indexcontroller.php
-------------------------------------------------
registry = zend_registry::getinstance();
$this->view = $this->registry['view'];
$this->view->baseurl = $this->_request->getbaseurl();
}
function indexaction(){
$this->view->word = 'hehe';
$this->view->render('index.html');
}
}
?>
--------------------------------------------------
index.html
------------------------------------------------
word;
?>
haha
------------------------------------------------------------------------
访问出现空白页面?
------解决方案--------------------
function indexaction(){
echo'test';
exit;
$this->view->word = 'hehe';
$this->view->render('index.html');
}
这样试试,看页面有没有打印出test,首先检查下是否进入了这个action。
还有,建议你把application.ini的错误输出打开
phpsettings.display_startup_errors = 1
phpsettings.display_errors = 1