Пример #1
0
 private function categoryJson()
 {
     $json = dirname(dirname(dirname(dirname(__DIR__)))) . "/public/json/category.json";
     $file = fopen($json, "wb");
     $category = new CdCategory();
     $find = $category->find();
     $content = array();
     foreach ($find as $values) {
         $content[$values->getCgid()] = $values->getName();
     }
     $category_json = json_encode($content);
     fwrite($file, $category_json);
     fclose($file);
 }
Пример #2
0
 function getCategoriesSections()
 {
     $auth = $this->auth();
     if ($auth) {
         $categories = new CdCategory();
         $ctg = array();
         foreach ($categories->find() as $key => $values) {
             $ctg[$values->getCgid()] = $values->getNameCategory();
         }
     } else {
         exit;
     }
 }