本文整理汇总了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');
}
示例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');
}
}
示例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);
}