出于好奇,我正在阅读Zend Engine API代码并在#define中遇到了相当多的##.例如,在/usr/lib/php5/Zend/zend_API.h:
#define ZEND_FN(name) zif_##name
#define ZEND_MN(name) zim_##name
Run Code Online (Sandbox Code Playgroud)
##(双哈希)符号在这两行中意味着什么?
在完成重定向后,我怎么能发送额外的视图参数(例如$ this - > _ redirect-> gotoSimple();)?
例如,假设我有一个Edit操作,它将用户重定向到Error操作处理程序,我希望能够向其视图发送自定义的详细错误消息.为了更清楚地说明,流程将是:
一个快速的代码片段可能看起来像:
public function editAction() {
//DO THINGS...
// Upon failure
if($fail) {
$this->_redirector->gotoUrl('/error/index');
//TODO: I need to be able to do something like
// $errorView->errorMessage = "Generic error";
}
}
Run Code Online (Sandbox Code Playgroud)
我们非常感谢任何解决方案,甚至其他更好的方法.