本文整理汇总了PHP中header::notfound方法的典型用法代码示例。如果您正苦于以下问题:PHP header::notfound方法的具体用法?PHP header::notfound怎么用?PHP header::notfound使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类header
的用法示例。
在下文中一共展示了header::notfound方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: headers
/**
* Sends all appropriate headers for this page
* Can be configured with the headers config array,
* which should contain all header definitions for each template
*/
public function headers()
{
$template = $this->template();
if (isset($this->kirby->options['headers'][$template])) {
$headers = $this->kirby->options['headers'][$template];
if (is_numeric($headers)) {
header::status($headers);
} else {
if (is_callable($headers)) {
call($headers, $this);
}
}
} else {
if ($this->isErrorPage()) {
header::notfound();
}
}
}
示例2: array
/* Custom Panel Stylesheet
---------------------------------------
Define a custom stylesheet to load in to the panel. See:
getkirby.com/docs/cheatsheet/options/panel.stylesheet
*/
c::set('panel.stylesheet', 'assets/css/panel.css');
/* Kirby Configuration
---------------------------------------
By default you don't have to configure anything to
make Kirby work. For more fine-grained configuration
please check out getkirby.com/docs/advanced/options
and getkirby.com/blog/multi-environment-setup
*/
// Routes
//
c::set('routes', array(array('pattern' => '(:any)', 'method' => 'ALL', 'action' => function ($path) {
if (!r::ajax()) {
header::notfound();
return site()->visit($path);
}
$page = page($path);
$has_api_method = method_exists($page, 'api');
return response::json(array('has_api_method' => $has_api_method));
}), array('pattern' => 'get/users.json', 'method' => 'ALL', 'action' => function () {
// if(!r::ajax()) {
// return header::forbidden();
// }
// $users = site()->users()->toArray();
// $r = array_combine($users,site()->users()->toArray()); // format for kirby select field
return response::json(array("first" => 'Rafe', "middle" => 'Jackson', "last" => 'Goldberg'));
})));