Exemple #1
0
 public function index()
 {
     // $data = Db::table('article')->get();
     // $count = count($data);
     // // p($_SERVER);exit;
     // // // p($count);exit;
     // // // p(Page::getTotalPage($data));exit;
     // $page = Page::row(10)->pageNum(3)->make($count);
     // $data = Db::table('article')->
     // limit(Page::limit())->get();
     // $num = Page::getTotalPage($page);
     // // p($num);exit;
     // View::with('page',$page)->with('data',$data)->make();
     $data = Db::table('article')->get();
     // p($data);
     $page = Page::row(10)->pageNum(4)->make(count($data));
     $data = Db::table('article')->limit(Page::limit())->get();
     p(Page::limit());
     $num = Page::getTotalPage();
     p($num);
     View::with('page', $page)->with('data', $data)->make();
 }
Exemple #2
0
 public function createCategoryConfig()
 {
     if (IS_POST) {
         $cat = Db::table('category')->get();
         $data = array();
         foreach ($cat as $c) {
             $_GET['id'] = $c['id'];
             ob_start();
             $obj = new \Home\Controller\IndexController();
             $obj->category();
             ob_get_clean();
             // $c['id'] = 20;
             $num = Page::getTotalPage();
             $data[$c['id']] = $num;
         }
         F('__HTML__', $data);
         go('createCategory');
     } else {
         F('__HTML__', '[del]');
         View::make();
     }
 }