상속: extends Controller
예제 #1
0
 public function mapPage(Router $router, Page $page)
 {
     $router->get($page->route, ['middleware' => 'secure.content', 'as' => $page->name, function () use($page) {
         $c = new PageController();
         return $c->show($page);
     }]);
     $router->get($page->route . '/edit', ['middleware' => 'secure.content', 'as' => $page->name . '.edit', function () use($page) {
         $c = new PageController();
         return $c->edit($page);
     }]);
     $router->post($page->route . '/update', ['as' => $page->name . '.update', function (Request $request) use($page) {
         $c = new PageController();
         return $c->update($request, $page);
     }]);
 }
 public function pages($url)
 {
     $menu = MenuController::getMenu();
     $categorys = CategoryController::getCategory();
     $info = InfoController::getInfo();
     $convert = new convertString();
     $pages = PageController::getPageWhereUrl($url);
     if (count($pages) == 0) {
         return View::make("errors.404");
     }
     $header = array("title" => $pages[0]->name . "- phụ kiện thời trang", "keyword" => "Liên hệ-phụ kiện thời trang", "description" => "Liên hệ-phụ kiện thời trang");
     foreach ($info as $values) {
         if ($values->name == "keyword" && $values->contents != "") {
             $header["keyword"] = $values->contents;
         }
         if ($values->name == "description" && $values->contents != "") {
             $header["description"] = $values->contents;
         }
     }
     if (count($menu) > 0) {
         $menu = $this->ConvertMenuToArray($menu);
     }
     return view::make("page", array('menu' => $menu, "categorys" => $categorys, "info" => $info, "convert" => $convert, "header" => $header, "pages" => $pages));
 }