yaf之工作笔记

获取渲染后的html:
 

$this->data['head'] = $this->_view->render("bootstarp/public/system_head.php", $this->data);

yaf异常模式:
[debug : common]
application.showErrors = 1
application.throwException = 1
application.dispatcher.catchException = 1
新增一个用来捕捉错误的Error Controller,然后渲染
 

class ErrorController extends Yaf\Controller_Abstract
{
	//从2.1开始, errorAction支持直接通过参数获取异常
	public function errorAction($exception)
	{
		//1. assign to view engine
		$this->getView()->assign("exception", $exception);
		//5. render by Yaf
	}
}

phpstrom友好提示yaf:phpstrom提示yaf

猜你喜欢

转载自blog.csdn.net/weixin_38230961/article/details/82787945