本文整理汇总了PHP中phpbb\controller\helper::error方法的典型用法代码示例。如果您正苦于以下问题:PHP helper::error方法的具体用法?PHP helper::error怎么用?PHP helper::error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpbb\controller\helper
的用法示例。
在下文中一共展示了helper::error方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
/**
* Controller for mChat
*
* @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
*/
public function handle()
{
$ret = $this->render_helper->render_data_for_page();
// If this was an ajax request, we just create an json_response and return that. It's not ours to handle here.
if ($this->request->is_ajax() && is_array($ret) && isset($ret['json']) && $ret['json'] === true) {
return new \Symfony\Component\HttpFoundation\JsonResponse($ret);
}
// If error occured, render it
if (isset($ret['error']) && $ret['error'] == true) {
return $this->helper->error($ret['error_text'], $ret['error_type']);
}
return $this->helper->render($ret['filename'], $ret['lang_title']);
}
示例2: suggest_tags
/**
* Gets suggestions for tags based on a ajax request, route: /tags/suggest
*
* @param php://input raw post data must contain a json-encoded object of this structure: {"query":"...", "exclude":["...", "...", ...]}
*/
public function suggest_tags()
{
if (false && $this->request->is_ajax()) {
$data = json_decode(file_get_contents('php://input'), true);
$query = $data['query'];
$exclude = $data['exclude'];
$tags = $this->tags_manager->get_tag_suggestions($query, $exclude, 5);
$json_response = new json_response();
$json_response->send($tags);
}
// fake a 404
return $this->helper->error($this->user->lang('RH_TOPICTAGS_TAG_SUGGEST_TAG_ROUTE_ERROR', $this->helper->get_current_url()), 404);
}
示例3: finish
public function finish($message, $status_code, $redirect_time = 5, $route = 'slider_controller')
{
$this->meta_refresh($redirect_time, $route);
return $this->helper->error($this->user->lang($message), $status_code);
}
示例4: error
/**
* {@inheritDoc}
*/
public function error($message, $code = 500)
{
return parent::error($this->user->lang($message), $code);
}