当前位置: 首页>>代码示例>>PHP>>正文


PHP Category_Model::getAllCategories方法代码示例

本文整理汇总了PHP中Category_Model::getAllCategories方法的典型用法代码示例。如果您正苦于以下问题:PHP Category_Model::getAllCategories方法的具体用法?PHP Category_Model::getAllCategories怎么用?PHP Category_Model::getAllCategories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Category_Model的用法示例。


在下文中一共展示了Category_Model::getAllCategories方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: document

 public function document()
 {
     $allDepartments = Department_Model::getAllDepartments();
     $data = array('pageTitle' => 'Document Builder', 'bodyClass' => 'edit', 'builder' => 'document', 'headerModules' => json_decode($this->builder->getModules('header')), 'bodyModules' => json_decode($this->builder->getModules('body')), 'footerModules' => json_decode($this->builder->getModules('footer')), 'draftModules' => json_decode($this->builder->getDraftModules()), 'unpublishedModules' => json_decode($this->builder->getUnpublishedModules()), 'allCategories' => Category_Model::getAllCategories(), 'allDepartments' => Department_Model::getAllDepartments());
     $this->load->view('templates/header', $data);
     $this->load->view('builder/inner_navbar_view');
     $this->load->view('builder/document_builder_view');
     $this->load->view('templates/footer');
 }
开发者ID:brandon-bailey,项目名称:osdms,代码行数:9,代码来源:Builder.php

示例2: index

 public function index()
 {
     if ($this->session->admin) {
         $data = array('allCategories' => Category_Model::getAllCategories());
         $this->load->view('templates/header', array('pageTitle' => 'Category Settings'));
         $this->load->view('categories/category_view', $data);
         $this->load->view('templates/footer');
     } else {
         redirect('home');
     }
 }
开发者ID:brandon-bailey,项目名称:osdms,代码行数:11,代码来源:Category.php

示例3: loadData

 public function loadData()
 {
     $currentUserDept = $this->session->department;
     //CHM - Pull in the sub-select values
     if (!($tName = $this->cache->get('udfFields'))) {
         $query = $this->db->select('table_name')->where('field_type', 4)->get('udf');
         $tName = array();
         foreach ($query->result() as $data) {
             $explodeV = explode('_', $data->table_name);
             $tName[] = $explodeV[2];
             $i++;
         }
         $this->cache->save('udfFields', $tName, 600);
     }
     // We need to set a form value for the current user so that
     // they can be pre-selected on the form
     $availUsers = User_Model::getAllUsers();
     $usersArray = array();
     foreach ($availUsers as $availUser) {
         if ($availUser->id == $this->session->id) {
             $availUser->selected = 'checked';
         } else {
             $availUser->selected = '';
         }
         array_push($usersArray, $availUser);
     }
     // We need to set a form value for the current department so that
     // it can be pre-selected on the form
     $availDepartments = Department_Model::getAllDepartments();
     $departmentsArray = array();
     foreach ($availDepartments as $availDepartment) {
         if ($availDepartment->id == $currentUserDept) {
             $availDepartment->selected = 'checked';
         } else {
             $availDepartment->selected = '';
         }
         array_push($departmentsArray, $availDepartment);
     }
     $availCategories = Category_Model::getAllCategories();
     $catsArray = array();
     foreach ($availCategories as $availCategory) {
         array_push($catsArray, $availCategory);
     }
     //////Populate department perm list/////////////////
     $deptPermsArray = array();
     foreach ($departmentsArray as $dept) {
         $availDeptPerms = new stdClass();
         $availDeptPerms->name = $dept->name;
         $availDeptPerms->id = $dept->id;
         array_push($deptPermsArray, $availDeptPerms);
     }
     $data = array('tName' => $tName, 'availUsers' => $usersArray, 'allDepartments' => $availDepartments, 'deptPerms' => $departmentsArray, 'availCategories' => $catsArray);
     return json_encode($data);
 }
开发者ID:brandon-bailey,项目名称:osdms,代码行数:54,代码来源:Add_model.php


注:本文中的Category_Model::getAllCategories方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。