當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CI_Loader::helper方法代碼示例

本文整理匯總了PHP中CI_Loader::helper方法的典型用法代碼示例。如果您正苦於以下問題:PHP CI_Loader::helper方法的具體用法?PHP CI_Loader::helper怎麽用?PHP CI_Loader::helper使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CI_Loader的用法示例。


在下文中一共展示了CI_Loader::helper方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: helper

 /** Load a module helper **/
 public function helper($helper)
 {
     if (is_array($helper)) {
         return $this->helpers($helper);
     }
     if (isset($this->_ci_helpers[$helper])) {
         return;
     }
     list($path, $_helper) = Modules::find($helper . '_helper', $this->_module, 'helpers/');
     if ($path === FALSE) {
         return parent::helper($helper);
     }
     Modules::load_file($_helper, $path);
     $this->_ci_helpers[$_helper] = TRUE;
 }
開發者ID:netfreak,項目名稱:pyrocms,代碼行數:16,代碼來源:MY_Loader.php

示例2: helper

 /**
  * Helper Loader
  * Overridden to allow O_helpers to load after user helpers
  *
  * @param	string|string[]	$helpers	Helper name(s)
  * @return	object
  */
 public function helper($helpers = array())
 {
     /* load the helper(s) as normal */
     parent::helper($helpers);
     /* then try to load the orange helper */
     foreach ((array) $helpers as $helper) {
         /*
         Let's not waste time trying to load orange helpers we know don't exist.
         Since we created them we know if they exist or not
         */
         $helper = str_replace('_helper', '', basename($helper, '.php'));
         if (in_array($helper, $this->orange_extended_helpers)) {
             /* the orange helpers are always in the orange/helpers folder. Where else would they be? */
             $o_helper_file = __DIR__ . '/../helpers/o_' . $helper . '_helper.php';
             /* if real path returns the path and it's not already loaded */
             if (!$this->_ci_helpers[$o_helper_file]) {
                 /* mark it as loaded */
                 $this->_ci_helpers[$o_helper_file] = true;
                 /* and load it */
                 include $o_helper_file;
             }
         }
     }
 }
開發者ID:ProjectOrangeBox,項目名稱:snapshot,代碼行數:31,代碼來源:MY_Loader.php

示例3: redirect

 function BE_Controller()
 {
     $this->page_path = false;
     global $active_controller;
     global $active_show;
     $active_controller = $this;
     parent::__construct();
     $this->load->helper("url");
     if (!$this->is_installed() && $this->uri->segment(2) != "install" && $this->uri->segment(1) != "api") {
         redirect('/admin/install/index', 'location');
     }
     if ($this->is_installed()) {
         $this->load->database();
         @$this->load->library('datamapper');
     }
     if (!$active_show) {
         $this->show = new Show($this);
     } else {
         $this->show =& $active_show;
     }
     $this->load->model('BuilderEngine');
     $this->load->model('users');
     if ($this->is_installed()) {
         $this->load->model('user');
         global $cache;
         $this->load->model("cache");
         $cache = $this->cache;
         $this->BuilderEngine->load_settings();
         if (!EventManager::is_initialized() && !EventManager::is_initializing()) {
             EventManager::set_initializing(true);
             $this->load->model('module');
             $modules = $this->module;
             // $modules = new Module();
             foreach ($modules->get() as $module) {
                 if ($module->folder == "module_system") {
                     continue;
                 }
                 Modules::run($module->folder . "/register_events");
             }
             EventManager::set_initialized(true);
         }
         if (self::$s_user == null) {
             self::$s_user = new User();
             $session = $this->session;
             self::$s_user->_init($session);
         }
         $user_model = $this->users;
         global $user;
         $user = self::$s_user;
         $this->user =& self::$s_user;
         $CI =& get_instance();
         $this->load->model('links');
         $this->links_array = $this->links->get();
         foreach ($this->links_array as $link) {
             $link->target = str_replace("%site_root%", home_url('/'), $link->target);
         }
     }
     $this->BuilderEngine->set_option("active_backend_theme", "dashboard", false);
     $this->load->library('module_parser');
     $this->load->library('parser');
     //$this->BuilderEngine->activate_theme("default");
     //echo $this->get_page_path();
     $this->load->module("layout_system");
     $this->layout_system->load->model("blocks");
     $this->layout_system->load->model('versions');
     $this->versions =& $this->layout_system->versions;
     if ($this->is_installed()) {
         $this->load->model('Module');
         $this->load->model('Group');
         $this->load->model('Group_module_permission');
     }
 }
開發者ID:hyrmedia,項目名稱:builderengine,代碼行數:72,代碼來源:BE_Controller.php

示例4: helper

 /** Load a module helper **/
 public function helper($helper = array())
 {
     if (is_array($helper)) {
         return $this->helpers($helper);
     }
     // Modified by Ivan Tcholakov, 12-DEC-2013.
     // See https://github.com/EllisLab/CodeIgniter/issues/2165
     //if (isset($this->_ci_helpers[$helper]))    return;
     if (isset($this->_ci_helpers[$helper])) {
         return $this;
     }
     //
     list($path, $_helper) = Modules::find($helper . '_helper', $this->_module, 'helpers/');
     // Modified by Ivan Tcholakov, 12-DEC-2013.
     // See https://github.com/EllisLab/CodeIgniter/issues/2165
     //if ($path === FALSE) return parent::helper($helper);
     if ($path === FALSE) {
         parent::helper($helper);
         return $this;
     }
     //
     Modules::load_file($_helper, $path);
     $this->_ci_helpers[$_helper] = TRUE;
     // Added by Ivan Tcholakov, 12-DEC-2013.
     // See https://github.com/EllisLab/CodeIgniter/issues/2165
     return $this;
     //
 }
開發者ID:jaffarsolo,項目名稱:starter-public-edition-4,代碼行數:29,代碼來源:Loader.php

示例5: helper

 /**
  * Load Helper
  *
  * This function loads the specified helper file.
  *
  * @param	mixed
  * @return	void
  */
 public function helper($helper = array())
 {
     if (is_array($helper)) {
         foreach ($helper as $help) {
             $this->helper($help);
         }
         return;
     }
     // Detect module
     if (list($module, $class) = $this->detect_module($helper)) {
         // Module already loaded
         if (in_array($module, $this->_ci_modules)) {
             return parent::helper($class);
         }
         // Add module
         $this->add_module($module);
         // Let parent do the heavy work
         $void = parent::helper($class);
         // Remove module
         $this->remove_module();
         return $void;
     } else {
         return parent::helper($helper);
     }
 }
開發者ID:sastrylal,項目名稱:tingting,代碼行數:33,代碼來源:Loader.php

示例6: helper

 /** Load a module helper **/
 public function helper($helpers = array())
 {
     if (is_array($helpers)) {
         return $this->helpers($helpers);
     }
     if (isset($this->_ci_helpers[$helpers])) {
         return;
     }
     list($path, $_helper) = Modules::find($helpers . '_helper', $this->_module, 'helpers/');
     if ($path === false) {
         return parent::helper($helpers);
     }
     Modules::load_file($_helper, $path);
     $this->_ci_helpers[$_helper] = true;
 }
開發者ID:blekedeg,項目名稱:lbhpers,代碼行數:16,代碼來源:Loader.php

示例7: helper

 /** Load a module helper **/
 public function helper($helper = array())
 {
     if (is_array($helper)) {
         return $this->helpers($helper);
     }
     if (isset($this->_ci_helpers[$helper])) {
         return;
     }
     list($path, $_helper, $ext_helper) = Modules::find($helper . '_helper', $this->_module, 'helpers/', $this->_module_location);
     // Are we simply loading an extended helper?
     if ($ext_helper) {
         Modules::load_file(config_item('subclass_prefix') . $_helper, $path);
         // Force the helper we are extending to load as well
         $segments = explode('/', $helper);
         $helper = isset($segments[1]) ? $segments[1] : $helper;
         $path = FALSE;
     }
     if ($path === FALSE) {
         return parent::helper($helper);
     }
     Modules::load_file($_helper, $path);
     $this->_ci_helpers[$_helper] = TRUE;
 }
開發者ID:darkwebside,項目名稱:codeigniter-modular-extensions-hmvc,代碼行數:24,代碼來源:Loader.php

示例8: helper

 /**
  * {inheritdoc}
  */
 public function helper($helper = [])
 {
     if (is_array($helper)) {
         foreach ($helper as $file) {
             $this->helper($file);
         }
         return;
     }
     // Detect helper from system
     $extension = '_helper.php';
     if (file_exists(BASEPATH . 'helpers/' . $helper . $extension && ($modules = $this->module->getList('module')))) {
         foreach ($modules as $module) {
             $mod_path = $this->module->getPath($module->name);
             if (file_exists($mod_path . 'helpers/' . $helper . $extension)) {
                 $this->helper($module->name . '/' . $helper);
             }
         }
     }
     // Detect helpers from module
     if (list($module, $file) = $this->module->detect($helper)) {
         // Module already loaded
         if (!$this->module->loaded($module)) {
             // Add module
             $this->module->add($this, $module);
         }
         // Let parent do the heavy work
         $void = parent::helper($file);
         // Remove module
         $this->module->remove($this);
         return $void;
     }
     return parent::helper($helper);
 }
開發者ID:bootigniter,項目名稱:project,代碼行數:36,代碼來源:Loader.php


注:本文中的CI_Loader::helper方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。