Beispiel #1
0
 public function __construct(Request $request)
 {
     $this->container = App::get();
     if (!empty($this->container['router'])) {
         $this->router = $this->container['router'];
     }
     $this->request = $request;
 }
Beispiel #2
0
 public function __construct()
 {
     $this->container = App::get();
     if (isset($this->container['view'])) {
         $this->view = $this->container['view'];
     }
     $this->setConnect();
     $this->run();
 }
Beispiel #3
0
 function view($path, array $data = [])
 {
     return App::get()['view']->render($path, $data);
 }
Beispiel #4
0
|--------------------------------------------------------------------------
|
| configuration template engine
|
*/
$container['viewPath'] = VIEW_PATH;
$container['cachePath'] = CACHE_PATH;
$container['engine'] = function ($c) {
    return new Engine();
};
$container['view'] = $container->asShared(function ($c) {
    return new View($c['viewPath'], $c['cachePath'], $c['engine']);
});
/*
|--------------------------------------------------------------------------
| App
|--------------------------------------------------------------------------
|
| Container
|
*/
App::set($container);
/*
|--------------------------------------------------------------------------
| Dispatcher
|--------------------------------------------------------------------------
|
| Simple framework dispatch
|
*/
$dispatcher = new Dispatcher(new Request());