本文整理汇总了PHP中CI_Loader类的典型用法代码示例。如果您正苦于以下问题:PHP CI_Loader类的具体用法?PHP CI_Loader怎么用?PHP CI_Loader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CI_Loader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initUploadImage
/**
* 提供按钮的ID列表,初始化插件组件
* @param array $buttonIds
* @param string $uploadUrl
* @param string $secType 选择图片类型(local:本地上传,remote:远程图片,all:本地远程图片)
* @param string $managerUrl 远程图片列表地址(远程图片列表json格式,具体格式参考模板文件)
*/
function initUploadImage($buttonIds = array(), $uploadUrl = '', $secType = 'local', $managerUrl = '')
{
$data = array('buttonIds' => $buttonIds, 'uploadUrl' => $uploadUrl, 'secType' => $secType, 'managerUrl' => $managerUrl);
$loader = new CI_Loader();
$content = $loader->view('common/initUploadImage', $data, true);
echo $content;
}
示例2: show_view
function show_view($view, $vars = array(), $return = FALSE)
{
$load = new CI_Loader();
$load->view("includes/header");
$load->view($view, $vars, $return);
$load->view("includes/footer");
}
示例3: CI_Base
function CI_Base()
{
global $OBJ;
parent::CI_Loader();
$this->load =& $this;
$OBJ = $this->load;
}
示例4: init
/**
* Initialize both database and forge components
*/
public static function init($driver)
{
if (empty(static::$db) && empty(static::$forge)) {
$config = Mock_Database_DB::config($driver);
$connection = new Mock_Database_DB($config);
$db = Mock_Database_DB::DB($connection->set_dsn($driver), TRUE);
CI_TestCase::instance()->ci_instance_var('db', $db);
$loader = new CI_Loader();
$loader->dbforge();
$forge = CI_TestCase::instance()->ci_instance_var('dbforge');
static::$db = $db;
static::$forge = $forge;
static::$driver = $driver;
}
return static::$db;
}
示例5: model
/**
* (non-PHPdoc)
* @see CI_Loader::model()
*/
public function model($model, $name = '', $db_conn = FALSE)
{
if (is_string($model) && $name == '') {
$name = $model;
$model = $model . '_model';
}
parent::model($model, $name, $db_conn);
}
示例6: printProActItem
/**
* 打印题目数据
* @param array $data
*/
function printProActItem($data)
{
//操作类型(edit:编辑,check:查看,)
$data['action'] = isset($data['action']) ? $data['action'] : 'edit';
$loader = new CI_Loader();
//上传图片配置
if ($data['type'] == 6) {
$data['uploadUrl'] = printUrl('Upload', 'uploadSave', array('dir' => 'image'));
$data['extraParams'] = array('itemId' => $data['itemId'], 'proId' => $data['proId'], 'actId' => $data['actId'], 'type' => $data['type']);
}
//上传附件配置
if ($data['type'] == 7) {
$data['uploadUrl'] = printUrl('Upload', 'uploadSave', array('dir' => 'settleFile'));
$data['extraParams'] = array('itemId' => $data['itemId'], 'proId' => $data['proId'], 'actId' => $data['actId'], 'type' => $data['type']);
}
$content = $loader->view('ProActItem/actItem' . $data['type'], $data, true);
echo $content;
}
示例7: render_view
public function render_view($view, $breadcrumbs, $data, $folder = 'admin', $js = [], $css = [], $return = false)
{
// Загружаем хэдер
$page['footer'] = $this->load->view('_blocks/header', ['page_title' => lang('main_title'), 'custom_js' => $js, 'custom_css' => $css, 'menus' => $this->get_menus(), 'menu_item' => $this->menu_item, 'breadcrumbs' => $breadcrumbs], $return);
// Загружаем шаблон страницы
$page['body'] = $this->load->view($folder . '/' . $view, $data, $return);
// Загружаем футер
$page['footer'] = $this->load->view('_blocks/footer', [], $return);
if ($return) {
return implode('', $page);
}
}
示例8: __construct
/**
* Check & Set URI resource to determine the side of application
*
*/
public function __construct()
{
parent::__construct();
$uri =& load_class('URI', 'core');
$admin = $uri->segment(1);
$this->is_admin = $admin == 'administrator' || $admin == 'admin' ? true : false;
}
示例9: showError
function MY_Controller()
{
parent::Controller();
//当前用户信息初始化
$this->load->library('User', null, 'userLib');
$userInfo = $this->userLib->getUserInfo();
$this->user = $userInfo;
if (!$this->user) {
showError($this->userLib->error, '/');
}
/* if (in_array($this->user['userId'], array(694,3767,3868))) {
showError('测试账号禁止进去正式地址');
} */
//加载菜单,全局使用
$this->load->library('Navbar', $this->user);
$this->navbarList = $this->navbar->getNavbarList();
//公告内容
$this->load->model('HelperNoticeModel');
$this->viewData['noticeData'] = $this->HelperNoticeModel->getLatest($this->user['userRole']);
if ($this->viewData['noticeData']) {
$this->navbarList[] = array('Help', 'noticeCheck', 'title' => '公告');
}
//当前选中菜单默认为当前控制器
$this->navbarFocus = $this->input->get('c');
//当前默认选中的菜单项
$this->navChildFocus = $this->input->get('c') . '_' . $this->input->get('m');
//当前主题
$this->theme = $this->config->item('theme');
//加载认证类,全局可以调用
$this->load->library('Auth', $this->user);
//面包屑导航
$this->viewData['breadcrumb'][] = array('url' => printUrl('Main', 'index'), 'title' => '首页');
//加载时段模型
$this->load->model('timeUnitModel');
}
示例10: __construct
/**
* Class constructor method
*/
public function __construct()
{
parent::__construct();
$this->config('loader', TRUE);
$this->_initialize();
log_message('info', __CLASS__ . ' Class Initialized');
}
示例11: __construct
/**
* Constructor
*
* @access public
*/
public function __construct()
{
parent::__construct();
$this->_ci_service_paths = array(APPPATH);
$this->_ci_services = array();
log_message('debug', "MY_Loader Class Initialized");
}
示例12: view
public function view($view, $vars = array(), $return = FALSE)
{
$CI =& get_instance();
if (isset($CI->local)) {
$file_exists = FALSE;
$_ci_path = '';
$_ci_view = $view . '__' . $CI->local['code'];
$_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION);
$_ci_file = $_ci_ext === '' ? $_ci_view . '.php' : $_ci_view;
foreach ($this->_ci_view_paths as $_ci_view_file => $cascade) {
if (file_exists($_ci_view_file . $_ci_file)) {
$_ci_path = $_ci_view_file . $_ci_file;
$file_exists = TRUE;
break;
}
if (!$cascade) {
break;
}
}
if ($file_exists or file_exists($_ci_path)) {
$view = $_ci_view;
}
}
return parent::view($view, $vars, $return);
}
示例13: define
/**
* Constructor. Define SPARKPATH if it doesn't exist, initialize parent
*/
function __construct()
{
if (!defined('SPARKPATH')) {
define('SPARKPATH', APPPATH . 'sparks/');
}
parent::__construct();
}
示例14: __construct
public function __construct()
{
$this->_ci_library_paths = array(PATH_APP, PATH_APPS, PATH_SYSTEM);
$this->_ci_helper_paths = array(PATH_APP, PATH_APPS, PATH_SYSTEM);
$this->_ci_view_paths = array(VIEWPATH => TRUE, MODULES_DIR => TRUE);
parent::__construct();
}
示例15: define
function __construct()
{
if (!defined('SPARKPATH')) {
define('SPARKPATH', 'sparks/');
}
$this->_ci_events_paths = array(APPPATH);
parent::__construct();
}