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


PHP theme::getCurrentLayoutOrPartial方法代碼示例

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


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

示例1: compile_widgets

    function compile_widgets($tag_args, &$smarty)
    {
        if ($tag_args['id']) {
            $id = ',' . $tag_args['id'];
        }
        $current_file = theme::getCurrentLayoutOrPartial();
        $current_file = substr($current_file, strpos($current_file, ':') + 1);
        if ($tag_args['id']) {
            return '$s=' . var_export($current_file, 1) . ';
			$i = intval($__wgbar[$s]++);
			echo \'<div class="shopWidgets_panel" base_file="\'.$s.\'" base_slot="\'.$i.\'" base_id=' . $tag_args['id'] . ' widgets_theme="">\';
			kernel::single(\'site_theme_widget\')->admin_load($s,$i' . $id . ');echo \'</div>\';';
        } else {
            return '$s=' . var_export($current_file, 1) . ';
			$i = intval($__wgbar[$s]++);
			echo \'<div class="shopWidgets_panel" base_file="\'.$s.\'" base_slot="\'.$i.\'" base_id="" widgets_theme="">\';
			kernel::single(\'site_theme_widget\')->admin_load($s,$i' . $id . ');echo \'</div>\';';
        }
    }
開發者ID:453111208,項目名稱:bbc,代碼行數:19,代碼來源:complier.php

示例2: compile_widgets

 function compile_widgets($attrs, &$compiler)
 {
     $current_file = theme::getCurrentLayoutOrPartial();
     $current_file = substr($current_file, strpos($current_file, ':') + 1);
     $slot = intval(static::$_wgbar[$current_file]++);
     $allWidgetsGroup = static::$_cache[$current_file];
     if (!isset($allWidgetsGroup)) {
         // preview模式, 並且SESSION中存在數據
         if (theme::isPreview() && $_SESSION['WIDGET_TMP_DATA'][$current_file] && is_array($_SESSION['WIDGET_TMP_DATA'][$current_file])) {
             $widgets = (array) $_SESSION['WIDGET_TMP_DATA'][$current_file];
         } else {
             $qb = app::get('site')->database()->createQueryBuilder();
             $qb->select('*')->from('site_widgets_instance')->where('core_file=' . $qb->createPositionalParameter($current_file))->orderBy('widgets_order', 'asc');
             $widgets = app::get('site')->model('widgets_instance')->tidy_data($qb->execute()->fetchAll());
         }
         foreach ($widgets as $key => $widget) {
             if ($widget['core_id']) {
                 $allWidgetsGroup['id'][$widget['core_id']][] = $widgets[$key];
             } else {
                 $allWidgetsGroup['slot'][$widget['core_slot']][] = $widgets[$key];
             }
         }
         static::$_cache[$current_file] = $allWidgetsGroup;
     }
     if (isset($attrs['id'])) {
         $attrs['id'] = trim($attrs['id'], '\'"');
         $widgets_group = $allWidgetsGroup['id'][$attrs['id']];
     } else {
         $widgets_group = $allWidgetsGroup['slot'][$slot];
     }
     /*--------------------- 獲取全部widgets ------------------------------*/
     if (is_array($widgets_group)) {
         $return = sprintf('$__THEME_URL = \'%s\';', kernel::get_themes_host_url() . '/' . theme::getThemeName());
         $return .= 'unset($this->_vars);';
         foreach ($widgets_group as $widget) {
             $return .= $this->__site_parse_widget_instance($widget, $compiler);
         }
         return $return . '$__widgets_setting=null;$__THEME_URL=null;$__widgets_id=null;$__widgets_data=null;';
     } else {
         return '';
     }
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:42,代碼來源:compiler.php


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