public function Index() { echo 'helloworld'; $confDict = AppBox::make('boxconf')->get('common.itemPerPages'); var_dump($confDict); $clearResult = AppBox::make('boxrouteconf')->cacheFlush(); var_dump($clearResult); $routeConf = AppBox::make('boxrouteconf')->getRouteConfByScript('redis', 'mygroup', array('id' => 3)); var_dump($routeConf); $routeInstance = AppBox::make('boxrouteinst')->getRouteInstance('cfg', 'mygroup', array('id' => 3)); var_dump($routeInstance); $instance = $routeInstance->getInstance(); var_dump($instance); $getCurrentUri = BoxDispatcher::getCurrentUri(); var_dump($getCurrentUri); $getCurrentDomain = BoxDispatcher::getDomain(); var_dump($getCurrentDomain); }
* @author nickfan<*****@*****.**> * @link http://www.axiong.me * @version $Id$ * @lastmodified: 2014-06-16 14:41 * */ use NoahBuscher\Macaw\Macaw as Route; use Nickfan\AppBox\Common\BoxConstants; use Nickfan\BoxApp\Support\Facades\BoxDispatcher; use Nickfan\BoxApp\Support\Facades\BoxView; Route::get('/favicon.ico', function () { $content = base64_decode(BoxConstants::TRANSGIFDATA); $contentType = 'image/gif'; header('Content-Type: ' . $contentType); header('Content-Length: ' . strlen($content)); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); echo $content; exit; }); Route::get('/', function () { return BoxView::make('hello')->render(); }); Route::get('/hello', function () { echo 'Welcome to AppBox' . '<br>' . PHP_EOL; echo BoxDispatcher::getHost() . '<br>' . PHP_EOL; echo BoxDispatcher::getDomain() . '<br>' . PHP_EOL; }); Route::get('/box', '\\App\\Boxcontrollers\\Localhost\\Index\\Index@Index'); Route::get('/ping', '\\App\\Boxcontrollers\\Localhost\\Index\\Index@Ping');