本文整理汇总了PHP中router::render_view方法的典型用法代码示例。如果您正苦于以下问题:PHP router::render_view方法的具体用法?PHP router::render_view怎么用?PHP router::render_view使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类router
的用法示例。
在下文中一共展示了router::render_view方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: perform_controller_action
static function perform_controller_action($class_path, $action, $objects, $parameters)
{
//We treat 'new' the same as 'edit', since they generally contain a lot of the same code
if ($action == "new") {
$action = "edit";
}
//Let's look for a controller
$controller_path = SITE_PATH . "/controllers/" . $class_path . "_controller.php";
if (file_exists($controller_path)) {
require_once $controller_path;
$class_path_components = explode("/", $class_path);
$class = $class_path_components[count($class_path_components) - 1];
$controller_class = $class . "_controller";
if (!method_exists($controller_class, $action)) {
if (router::render_view($class_path, $action)) {
exit;
} else {
fatal_error("{$controller_class} does not respond to {$action}");
}
}
$controller = new $controller_class();
$controller->parameters = $parameters;
call_user_func_array(array($controller, $action), $objects);
exit;
}
//If no controller was found, we'll look for a view
if (router::render_view($class_path, $action)) {
exit;
}
}