本文整理汇总了PHP中bootstrap::config方法的典型用法代码示例。如果您正苦于以下问题:PHP bootstrap::config方法的具体用法?PHP bootstrap::config怎么用?PHP bootstrap::config使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bootstrap
的用法示例。
在下文中一共展示了bootstrap::config方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: start
public static function start()
{
# load config
$config = (include __DIR__ . '/settings.php');
self::$config = $config;
self::loadClasses();
# bind array $config ke class Connection
Connection::setConfig(self::$config['db']);
# make a route
$router = new Route(self::$config);
# match the current request
$match = $router->getRoute()->match();
if ($match && is_callable($match['target'])) {
call_user_func_array($match['target'], $match['params']);
} else {
# no route was matched
header($_SERVER["SERVER_PROTOCOL"] . ' 404 Not Found');
echo "<h3>No Route was matched with</h3>";
echo "<table>";
echo "<tr>";
echo "<th>Method</th>";
echo "<th>Route</th>";
echo "</tr>";
// echo "<td>Controller</td>";
foreach ($router->getRoute()->getRoutes() as $route) {
print "<tr>";
print "<td> {$route['0']} </td>";
print "<td> {$route['1']} </td>";
print "<tr>";
}
echo "</table>";
}
}