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


PHP CI_Loader::view方法代碼示例

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


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

示例1: array

 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");
 }
開發者ID:egemenozkan,項目名稱:cibs,代碼行數:7,代碼來源:view_helper.php

示例2: 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);
     }
 }
開發者ID:Speennaker,項目名稱:cometogether,代碼行數:12,代碼來源:MY_base_controller.php

示例3: 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);
 }
開發者ID:aidou-com,項目名稱:pro-3,代碼行數:25,代碼來源:MY_Loader.php

示例4: 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;
}
開發者ID:zhaojianhui129,項目名稱:rmp2016,代碼行數:14,代碼來源:initjs_helper.php

示例5: view

 function view($view, $params = array(), $string = false)
 {
     $str_contenido = parent::view($view, $params, true);
     $str = parent::view("layout/layout", array("contenido" => $str_contenido), true);
     if ($string) {
         return $str;
     } else {
         echo $str;
     }
 }
開發者ID:josercl,項目名稱:forum,代碼行數:10,代碼來源:MY_Loader.php

示例6: view

 function view($view, $vars = array(), $return = FALSE)
 {
     // if $view is an array, bump all parameters up
     if (is_array($view)) {
         $return = !is_array($vars);
         $vars = $view;
         global $RTR;
         return parent::view($RTR->fetch_method(), $vars, $return);
     } else {
         return parent::view($view, $vars, $return);
     }
 }
開發者ID:allviss,項目名稱:wp-ci,代碼行數:12,代碼來源:MY_Loader.php

示例7: view

 /**
  * Load CI View
  *
  * This is extended to keep some backward compatibility for people
  * changing _ci_view_path. I tried doing a getter/setter, but since all
  * of CI's object references are stuck onto the loader when loading views
  * I get access errors left and right. -pk
  *
  * @deprecated
  * @access	public
  */
 public function view($view, $vars = array(), $return = FALSE)
 {
     if ($this->ee_view_depth === 0 && $this->_ci_view_path != '') {
         $this->_ci_view_paths = array($this->_ci_view_path => FALSE) + $this->_ci_view_paths;
     }
     $this->ee_view_depth++;
     $ret = parent::view($view, $vars, $return);
     $this->ee_view_depth--;
     if ($this->ee_view_depth === 0 && $this->_ci_view_path != '') {
         array_shift($this->_ci_view_paths);
     }
     return $ret;
 }
開發者ID:thomasvandoren,項目名稱:teentix-site,代碼行數:24,代碼來源:EE_Loader.php

示例8: view

 public function view($view, $vars = array(), $return = FALSE)
 {
     global $view_folder;
     /*
     		$CI =& get_instance();
     		$lang = $CI->security->sanitize_filename( $CI->config->item('language') );
     
     		if( file_exists($view_folder.$lang.'/'.$view.'.php') )
     		{
     			$view = $lang.'/'.$view;
     		}
     */
     return parent::view($view, $vars, $return);
 }
開發者ID:Orelab,項目名稱:election-libre,代碼行數:14,代碼來源:EL_Loader.php

示例9: view

 public function view($view, $vars = array(), $return = FALSE)
 {
     // XXX: yep, this is all pretty hacky. is there a better way to do this in CI?
     if ($this->request_is_format('json') && !in_array($view, self::$ALWAYS_ALLOW_HTML_VIEWS)) {
         // ignore header/footer calls for JSON calls
         if (in_array($view, self::$HTML_ONLY_VIEWS)) {
             if ($return) {
                 return '';
             }
             return;
         }
         // TODO: search for "$view.json" on filesystem before attempting to load it
         $view .= '.json.php';
     }
     return parent::view($view, $vars, $return);
 }
開發者ID:notjosh,項目名稱:seaforium,代碼行數:16,代碼來源:MY_Loader.php

示例10: view

 /**
  * Load View
  *
  * This extended function exists to provide overloading of themes.  It's silly and
  * difficult trying to maintain multiple themes that are just tweaks to CSS and images.
  * Brandon is a smart cookie for thinking this idea up.  -ga
  *
  * @param	string		
  * @param	array 	variables to be loaded into the view
  * @param	bool 	return or not
  * @return	void
  */
 public function view($view, $vars = array(), $return = FALSE)
 {
     $paths = $this->_ci_view_path;
     if (is_array($this->_ci_view_path)) {
         $ext = pathinfo($view, PATHINFO_EXTENSION);
         $ext = $ext ? '' : EXT;
         foreach ($this->_ci_view_path as $path) {
             if (file_exists($path . $view . $ext)) {
                 $this->_ci_view_path = $path;
                 break;
             }
         }
     }
     $ret = parent::view($view, $vars, $return);
     $this->_ci_view_path = $paths;
     return $ret;
 }
開發者ID:rmdort,項目名稱:adiee,代碼行數:29,代碼來源:EE_Loader.php

示例11: 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;
}
開發者ID:zhaojianhui129,項目名稱:implement2016,代碼行數:22,代碼來源:initjs_helper.php

示例12: view

 /**
  * Load CI View
  *
  * This is extended to keep some backward compatibility for people
  * changing _ci_view_path. I tried doing a getter/setter, but since all
  * of CI's object references are stuck onto the loader when loading views
  * I get access errors left and right. -pk
  *
  * @deprecated 2.6
  */
 public function view($view, $vars = array(), $return = FALSE)
 {
     if ($this->ee_view_depth === 0 && $this->_ci_view_path != '') {
         ee()->load->library('logger');
         ee()->logger->deprecated('2.6', 'load::add_package_path()');
         $this->_ci_view_paths = array($this->_ci_view_path => FALSE) + $this->_ci_view_paths;
     }
     if (is_array($vars) && isset($vars['cp_page_title'])) {
         ee()->view->cp_page_title = $vars['cp_page_title'];
     }
     $this->ee_view_depth++;
     $ret = parent::view($view, $vars, $return);
     $this->ee_view_depth--;
     if ($this->ee_view_depth === 0 && $this->_ci_view_path != '') {
         array_shift($this->_ci_view_paths);
     }
     return $ret;
 }
開發者ID:nigelpeters,項目名稱:css-recruitment-ee,代碼行數:28,代碼來源:EE_Loader.php

示例13: view

 /**
  * @param $part_name: FALSE:進入輸出緩存, 否則存入Loader::part[$part_name]
  */
 function view($view, $return = FALSE, $block_name = FALSE)
 {
     if (array_key_exists($view, $this->view_path)) {
         $view = $this->view_path[$view];
     }
     $vars = $this->getViewData();
     //每次載入視圖時,都將當前視圖數據傳遞給他一次
     if ($block_name === FALSE) {
         return parent::view($view, $vars, $return);
     } else {
         if (!array_key_exists($block_name, $this->blocks)) {
             $this->blocks[$block_name] = '';
         }
         $block = parent::view($view, $vars, TRUE);
         $this->blocks[$block_name] .= $block;
         return $block;
     }
 }
開發者ID:flyingfish2013,項目名稱:Syssh,代碼行數:21,代碼來源:SS_Loader.php

示例14: view

 /**
  * @param string $aView
  * @param array $aData
  * @param string $aLayout
  * @param string $aLanguage The locale variant of the view file which should be used.
  */
 public function view($aView = null, $aData = array(), $aLayout = null, $aLanguage = null)
 {
     if (is_null($aView)) {
         $aView = strtolower($this->controllerName) . '/' . strtolower($this->controllerFunction);
     }
     $lLayout = is_null($aLayout) ? $this->layout : $aLayout;
     $lLanguage = is_null($aLanguage) ? $this->language : $aLanguage;
     $aData += array('viewLayout' => $lLayout, 'viewLanguage' => $lLanguage);
     $lViewsPath = APPPATH . 'views';
     $localizedViewPath = $lViewsPath . '/' . (!empty($lLayout) ? $lLayout . DIRECTORY_SEPARATOR : '') . $aView . '_' . $lLanguage . EXT;
     //    var_dump($lLanguage, $localizedViewPath);
     if (file_exists($localizedViewPath)) {
         //      var_dump($lLayout.DIRECTORY_SEPARATOR.$aView.'_'.$lLanguage);
         parent::view($lLayout . DIRECTORY_SEPARATOR . $aView . '_' . $lLanguage, $aData);
     } elseif (file_exists($lViewsPath . '/' . $lLayout . DIRECTORY_SEPARATOR . $aView . EXT)) {
         log_message('warning', sprintf('No localized version of %s could be found for language %s. Using non-localized one.', $aView, $lLanguage));
         parent::view($lLayout . DIRECTORY_SEPARATOR . $aView, $aData);
     } else {
         log_message('warning', sprintf('No default version of %s could be found. (Layout:"%s" Language: "%s")', $aView, $lLayout, $lLanguage));
         show_error(sprintf('Unable to load the requested file: "%s"; Layout: "%s"; Language "%s";', $lViewsPath . '/' . $lLayout . '/' . $aView . EXT, $lLanguage, $lLayout));
     }
 }
開發者ID:spockz,項目名稱:Spockz-Library-for-CodeIgniter,代碼行數:28,代碼來源:Loader.php

示例15: view

 /**
  * Load View
  *
  * This function is used to load a "view" file.  It has three parameters:
  *
  * 1. The name of the "view" file to be included.
  * 2. An associative array of data to be extracted for use in the view.
  * 3. TRUE/FALSE - whether to return the data or load it.  In
  * some cases it's advantageous to be able to return data so that
  * a developer can process it in some way.
  *
  * @param    string
  * @param    array
  * @param    bool
  * @return    void
  */
 public function view($view, $vars = array(), $return = FALSE)
 {
     if ($return === TRUE) {
         return parent::view($view, $vars, $return);
     }
     $output = $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => TRUE));
     $CI =& get_instance();
     $CI->output->append_view($view);
     $CI->output->append_output($output);
 }
開發者ID:shuzilin,項目名稱:CIUnit,代碼行數:26,代碼來源:CIU_Loader.php


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