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


PHP Base_module_model::options_list方法代码示例

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


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

示例1: array

 function options_list($key = 'fuel_user_id', $val = 'display_name', $where = array(), $order = 'display_name')
 {
     if ($key == 'id') {
         $key = $this->table_name . '.fuel_user_id';
     }
     if ($val == 'display_name') {
         $val = 'IF(display_name = "", fuel_users.email, display_name) AS name';
     }
     $this->db->join('fuel_users', 'fuel_users.id = fuel_blog_users.fuel_user_id', 'left');
     $return = parent::options_list($key, $val, $where, $order);
     return $return;
 }
开发者ID:kieranklaassen,项目名称:FUEL-CMS,代码行数:12,代码来源:blog_users_model.php

示例2: array

 function options_list($key = 'id', $val = 'name', $where = array(), $order = 'name')
 {
     $CI =& get_instance();
     if ($key == 'id') {
         $key = $this->table_name . '.id';
     }
     if ($val == 'name') {
         $val = 'CONCAT(first_name, " ", last_name) as name';
     }
     if (!$CI->fuel_auth->is_super_admin()) {
         $this->db->where(array('super_admin' => 'no'));
     }
     $return = parent::options_list($key, $val, $where, $order);
     return $return;
 }
开发者ID:randombrad,项目名称:FUEL-CMS,代码行数:15,代码来源:users_model.php

示例3: context_options_list

 /**
  * Initializes the class with the parent model and field names
  *
  * @access	public
  * @return	array
  */
 public function context_options_list()
 {
     $this->db->group_by('context');
     $this->db->where('context != ""');
     return parent::options_list('context', 'context');
 }
开发者ID:scotton34,项目名称:sample,代码行数:12,代码来源:fuel_categories_model.php

示例4: options_list

 /**
  * Overwritten: Allows for grouping of menu items with last paramter
  *
  * @access	public
  * @param	string	The column to use for the value (optional)
  * @param	string	The column to use for the label (optional)
  * @param	mixed	An array or string containg the where paramters of a query (optional)
  * @param	string	The order by of the query. defaults to $val asc (optional)
  * @param	boolean	Determines whether it will group the options together based on the menu troup (optional)
  * @return	array	 */
 public function options_list($key = 'id', $val = 'label', $where = array(), $order = TRUE, $group = TRUE)
 {
     if (!empty($order) and is_bool($order)) {
         $this->db->order_by($val, 'asc');
     } else {
         if (!empty($order) and is_string($order)) {
             if (strpos($order, ' ') === FALSE) {
                 $order .= ' asc';
             }
             $this->db->order_by($order);
         }
     }
     if ($group) {
         // need to turn this off to get the proper ordering
         $data = $this->find_all_array_assoc($key, $where);
         return $this->_group_options($data, $key, $val);
     } else {
         return parent::options_list($key, $val, $where, $order);
     }
 }
开发者ID:kbjohnson90,项目名称:FUEL-CMS,代码行数:30,代码来源:fuel_navigation_model.php

示例5: options_list

 /**
  * Overwrites the parent option_list method 
  *
  * @access	public
  * @param	string	the name of the field to be used as the key (optional)
  * @param	string	the name of the filed to be used as the value (optional)
  * @param	mixed	the where condition to apply (optional)
  * @param	mixed	the order in which to return the results (optional)
  * @return	array 	
  */
 public function options_list($key = 'id', $val = 'name', $where = array(), $order = TRUE)
 {
     $this->db->join($this->_tables['fuel_categories'], $this->_tables['fuel_categories'] . '.id = ' . $this->_tables['fuel_tags'] . '.category_id', 'LEFT');
     // if (empty($key)) $key = $this->_tables['fuel_categories'].'.id';
     // if (empty($val)) $val = $this->_tables['fuel_categories'].'.name';
     if (empty($key)) {
         $key = $this->_tables['fuel_tags'] . '.id';
     }
     if (empty($val)) {
         $val = $this->_tables['fuel_tags'] . '.name';
     }
     // needed to prevent ambiguity
     if (strpos($key, '.') === FALSE and strpos($key, '(') === FALSE) {
         $key = $this->_tables['fuel_tags'] . '.' . $key;
     }
     // needed to prevent ambiguity
     if (strpos($val, '.') === FALSE and strpos($val, '(') === FALSE) {
         $val = $this->_tables['fuel_tags'] . '.' . $val;
     }
     $options = parent::options_list($key, $val, $where, $order);
     return $options;
 }
开发者ID:huayuxian,项目名称:FUEL-CMS,代码行数:32,代码来源:fuel_tags_model.php

示例6: options_list_with_views

 public function options_list_with_views($where = array(), $dir_folder = '', $dir_filter = '^_(.*)|\\.html$', $order = TRUE, $recursive = TRUE)
 {
     $CI =& get_instance();
     $CI->load->helper('directory');
     $module_path = APPPATH;
     if (is_array($dir_folder)) {
         $module = key($dir_folder);
         $dir_folder = current($dir_folder);
         if (is_string($module)) {
             $module_path = MODULES_PATH . $module;
         }
     }
     $dir_folder = trim($dir_folder, '/');
     $blocks_path = $module_path . '/views/_blocks/' . $dir_folder;
     // don't display blocks with preceding underscores or .html files'
     $block_files = directory_to_array($blocks_path, $recursive, '#' . $dir_filter . '#', FALSE, TRUE);
     $view_blocks = array();
     foreach ($block_files as $block) {
         $view_blocks[$block] = $block;
     }
     // if a dir_folder exists, then we will look for any CMS blocks that may be prefixed with that dir_folder
     // (e.g. sections/left_block becomes just left_block)
     if (!empty($dir_folder) and empty($where)) {
         $where = 'name LIKE "' . $dir_folder . '/%"';
     }
     $blocks = parent::options_list('name', 'name', $where, $order);
     // continue filter of cms blocks dir_folder is specified
     $cms_blocks = array();
     if (!empty($dir_folder)) {
         $cms_blocks = array();
         foreach ($blocks as $key => $val) {
             $key = preg_replace('#^' . $dir_folder . '/(.+)#', '$1', $key);
             $cms_blocks[$key] = $key;
         }
     } else {
         $cms_blocks = $blocks;
     }
     $blocks = array_merge($view_blocks, $cms_blocks);
     if ($order) {
         ksort($blocks);
     }
     return $blocks;
 }
开发者ID:magicjoey,项目名称:FUEL-CMS,代码行数:43,代码来源:fuel_blocks_model.php


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