本文整理汇总了PHP中Base_module_model::tables方法的典型用法代码示例。如果您正苦于以下问题:PHP Base_module_model::tables方法的具体用法?PHP Base_module_model::tables怎么用?PHP Base_module_model::tables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Base_module_model
的用法示例。
在下文中一共展示了Base_module_model::tables方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load_config
/**
* Loads the advanced modules config file
*
* @access public
* @param string Name of config file. Default is the name of the advanced module (optional)
* @return void
*/
public function load_config($config = NULL)
{
if (empty($config)) {
$config = $this->name;
}
// last parameter tells it to fail gracefully
// check application directory for overwrites
$this->CI->load->module_config('app', $config, FALSE, TRUE);
$app_config = $this->CI->config->item($this->name);
// now get the blog configuration
$this->CI->load->module_config($this->folder(), $config, FALSE, TRUE);
$module_config = $this->CI->config->item($this->name);
// if app config exists then merge
if (!empty($app_config)) {
$this->_config = array_merge($module_config, $app_config);
} else {
$this->_config = $module_config;
}
// special case for tables so that they are loaded into the static Base_module_model variable
if ($this->CI->config->item('tables')) {
if (!class_exists('Base_module_model')) {
require_once BASEPATH . 'core/Model.php';
require_once FUEL_PATH . 'models/base_module_model.php';
}
Base_module_model::$tables = array_merge(Base_module_model::$tables, $this->CI->config->item('tables'));
}
}
示例2: __construct
/**
* Constructor
*
* @access public
* @param string The table name
* @param mixed If an array, it will assume they are initialization properties. If a string, it will assume it's the name of the module the module exists in
* @return void
*/
public function __construct($table = NULL, $params = NULL)
{
$CI =& get_instance();
$CI->load->module_language(FUEL_FOLDER, 'fuel');
// initialize parameters to pass to parent model
// if it is a string, then we assume it's a module name, if it is an array, then we extract the module name from it'
if (is_array($params)) {
if (isset($params['module'])) {
$module = $params['module'];
}
} else {
$module = $params;
$params = array();
}
if (!isset($module)) {
$module = FUEL_FOLDER;
}
$fuel_tables = array();
$module_tables = array();
$config_tables = array();
// first load the FUEL config so that we can get the tables
$CI->config->module_load(FUEL_FOLDER, 'fuel', TRUE);
$fuel_tables = $CI->config->item('tables', 'fuel');
// load in the module configuration file
if (!empty($module) and $module != FUEL_FOLDER) {
// fail gracefully is last parameter
$CI->config->module_load($module, $module, FALSE, TRUE);
if ($CI->config->item('tables')) {
$module_tables = $CI->config->item('tables');
}
}
// look in the generic configuration space
if ($CI->config->item('tables')) {
$config_tables = $CI->config->item('tables');
}
// create master list of tables
self::$tables = array_merge(self::$tables, $config_tables, $module_tables, $fuel_tables);
$this->set_tables(self::$tables);
// set the table to the configuration mapping if it is in array
if ($this->tables($table)) {
$table = $this->tables($table);
}
// if no configuration mapping is found then we will assume it is just the straight up table name
parent::__construct($table, $params);
// table name and params
// load additional helpers here
$this->load->helper('typography');
$this->load->helper('text');
$this->load->helper('markdown');
$this->load->helper('format');
// set formatters
if (!empty($this->_formatters) and !empty($this->formatters)) {
$this->formatters = array_merge_recursive($this->_formatters, $this->formatters);
} else {
$this->formatters = $this->_formatters;
}
}