Example #1
0
 public function route()
 {
     $router = new Router(\Phlex\Request\Request::getCurrent());
     $router->any('/API/*', function () {
         $router = new Router(\Phlex\Request\Request::getCurrent());
         return $router->any('*', function () {
             return false;
             'APIKeyCheckController, returns false on ok, renders error on error';
         })->get('/API/product/*', function () {
             return false;
         })->post('/API/product/*', function () {
             return false;
         });
     })->get('/articleData/*', function () {
         return ArticleController::factory()->someData();
     })->get('/article/*', function () {
         return ArticleController::factory()->articlePage();
     });
 }
Example #2
0
 protected function createView($args)
 {
     $view = ArticleController::factory()->articleComment($args);
     PageView::addServerVar('key', 'value');
     return $view;
 }