本文整理汇总了PHP中ActionController::run_after_filters方法的典型用法代码示例。如果您正苦于以下问题:PHP ActionController::run_after_filters方法的具体用法?PHP ActionController::run_after_filters怎么用?PHP ActionController::run_after_filters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActionController
的用法示例。
在下文中一共展示了ActionController::run_after_filters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirect_to
static function redirect_to($url, $url_params = array(), $redirect_params = array())
{
# Running after-filters!
ActionController::run_after_filters();
if ($redirect_params) {
self::parse_parameters($redirect_params);
}
$route = url_for($url, $url_params);
header("Location: {$route}");
exit;
}
示例2: define
define('ACTVIEW', SYSROOT . 'action_view/');
require SYSROOT . 'system.php';
require SYSROOT . 'config/config.php';
require SYSROOT . 'config/config_system.php';
require SYSROOT . 'database/initialize.php';
require SYSROOT . 'load_functions.php';
require SYSROOT . 'request.php';
require SYSROOT . 'action_controller.php';
require ACTVIEW . 'action_view.php';
require SYSROOT . 'status_codes.php';
require SYSROOT . 'active_record.php';
require ROOT . 'config/config.php';
require ROOT . 'config/routes.php';
System::start();
/**
* NOTE: in the case an action file needs to do "return;" (like post#show),
* it must NOT return false, else it will be taken like the file wasn't found,
* causing a missunderstanding.
* (This also applies when including partials)
*
* If an action returns an int, the system will exit with such HTTP status.
*/
$include = (include CTRLSPATH . Request::$controller . '/' . Request::$action . '.php');
if ($include === false) {
ActionController::exit_with_error(500, 'Could not find action file.');
} elseif (is_int($include) && $include !== 1) {
exit_with_status($include);
}
unset($include);
ActionController::run_after_filters();
include ACTVIEW . 'render.php';