本文整理汇总了PHP中Logs::error方法的典型用法代码示例。如果您正苦于以下问题:PHP Logs::error方法的具体用法?PHP Logs::error怎么用?PHP Logs::error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logs
的用法示例。
在下文中一共展示了Logs::error方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: start
public function start($url)
{
Logs::access("Connection to url " . $url);
\Twig_Autoloader::register();
$loader = new \Twig_Loader_Filesystem('src/View');
$twig = new \Twig_Environment($loader);
$url = explode("/", $url);
isset($url[0]) ? $controller = $url[0] : ($controller = null);
isset($url[1]) ? $action = $url[1] : ($action = null);
isset($url[2]) ? $param = $url[2] : ($param = null);
if ($controller != null) {
if (array_key_exists($controller, $this->route)) {
if ($action != null && in_array($action, $this->route[$controller])) {
$response['controller'] = $controller;
$response['action'] = $action;
$response['param'] = $param;
$namespace = "\\App\\Controller\\" . $controller;
$controller = new $namespace();
$response['result'] = $controller->{$action}($param);
$response["template"] = $twig->loadTemplate($response['controller'] . '/' . $response['action'] . '.twig');
return $response;
} else {
$response['controller'] = $controller;
$response['action'] = 'index';
$response['param'] = $action;
$namespace = "\\App\\Controller\\" . $controller;
$controller = new $namespace();
$response['result'] = $controller->index();
$response["template"] = $twig->loadTemplate($response['controller'] . '/index.twig');
return $response;
}
} else {
Logs::error("No controller " . $controller . ' Found');
$controller = "Home";
$response['controller'] = $controller;
$response['action'] = 'index';
$namespace = "\\App\\Controller\\" . $controller;
$controller = new $namespace();
$response['result'] = $controller->index();
$response["template"] = $twig->loadTemplate('Home/index.twig');
return $response;
}
} else {
$controller = "Home";
$response['controller'] = $controller;
$response['action'] = 'index';
$namespace = "\\App\\Controller\\" . $controller;
$controller = new $namespace();
$response['result'] = $controller->index();
$response["template"] = $twig->loadTemplate('Home/index.twig');
return $response;
}
}