function run() { $layoutDirectory = "" . __DIR__ . '/views/tmpl/default'; if (file_exists($layoutDirectory)) { try { $paths = new SplPriorityQueue(); $paths->insert($layoutDirectory, $this::PRIORITY); $view = new View($this->primaryModel, $paths); $view->setLayout('default'); printf($view->render()); } catch (RuntimeException $e) { printf("RuntimeException: ", $e); } } else { printf('Layout directory cannot be found!'); } }
public function getAccountIndex() { if (\Auth::account()->check()) { $user = \Auth::account()->get(); } else { return Redirect::to("account/login")->with("error_message", "Login faild"); } $user = \Auth::account()->get(); return \View::make("account.index")->with("categories", \DB::table("categories")->get())->with("countries", \DB::table("country")->get())->with("myorders", \DB::table("orders")->where("customer_id", $user->id)->get())->with("statuses", \DB::table("order_status")->get()); }