예제 #1
0
 /**
  * @param null $id
  */
 public static function index($id = null)
 {
     if (empty($id)) {
         $categories = Categories::all()->fetchAll(\PDO::FETCH_CLASS);
         View::render('categories/home', ['categories' => $categories]);
     } else {
         $categories = Categories::getOrFail(['id' => $id]);
         print_r($categories);
     }
 }