示例#1
0
 /**
  *
  * @param $subcategoryId int
  * @return nothing
  * @author Tremor
  */
 public function subcategory($subcategoryId = 0)
 {
     $this->data['active'] = __FUNCTION__;
     if (isset($subcategoryId) && !empty($subcategoryId) && is_numeric($subcategoryId)) {
         $this->data['categoryList'] = Category::lists('name', 'id');
         $this->data['subcategory'] = Subcategory::find($subcategoryId);
         return View::make('admin.subcategory.one')->with($this->data);
     } else {
         $this->data['subcategoryList'] = Subcategory::orderBy('sort', 'asc')->get();
         return View::make('admin.subcategory.list')->with($this->data);
     }
 }