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


PHP Template::getInstance方法代碼示例

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


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

示例1: __construct

 public function __construct()
 {
     $this->url = URL::getInstance();
     $this->template = Template::getInstance();
     $this->request = Request::getInstance();
     $this->values = Values::getInstance();
 }
開發者ID:anzasolutions,項目名稱:simlandia,代碼行數:7,代碼來源:abstractview.class.php

示例2: js

    public function js()
    {
        $row = $this->input->getInt('row');
        $col = $this->input->getInt('col');
        $uid = $this->input->getInt('uid');
        $count = $row * $col;
        $sql = 'SELECT
		    ads.*
		  FROM ck_ads as ads
		  JOIN ck_packages as pack
		    ON(ads.package_id=pack.id)
		  WHERE
		    ads.status="approve"   AND
		    ads.clicked < pack.max_click
		  ORDER BY RAND()
		  LIMIT ' . $count;
        $query = $this->db->query($sql);
        $tmpl = Template::getInstance('empty.tpl');
        $tmpl->loadPage('jsAds');
        fb($col, 'row');
        for ($i = 0; $i < $row; ++$i) {
            $tmp = array();
            for ($j = 0; $j < $col; ++$j) {
                $tmp[] = $query->fetch();
            }
            $data[] = $tmp;
        }
        fb($data);
        $tmpl->assign('uid', $uid);
        $tmpl->assign('row', $row);
        $tmpl->assign('col', $col);
        $tmpl->assign('data', $data);
        Response::getInstance()->setTemplate($tmpl);
    }
開發者ID:redknight,項目名稱:frot,代碼行數:34,代碼來源:ClickAdsService.php

示例3: editAction

 public function editAction()
 {
     //on charge le model de formation
     $maFormationSession = App::getModel('FormationSession');
     //crée la liste des matières via une collection
     $collection = App::getCollection('Formation');
     $collection->select();
     $coll_for = $collection->getItems();
     if (isset($_GET['id'])) {
         $maFormationSession->load($_GET['id']);
     }
     if (isset($_POST['submit'])) {
         //Si id existe et n'est pas vide, on modifie
         if (isset($_POST['id']) && !empty($_POST['id'])) {
             $maFormationSession->store(array('id' => $_POST['id']));
         } else {
             //sinon c'est une création
             $maFormationSession->store(array('id' => 0));
         }
         $maFormationSession->store(array('begin_date' => $_POST['begin_date'], 'ending_date' => $_POST['ending_date'], 'formations_id' => $_POST['formations']));
         //on appelle la méthode qui stock les infos dans l'objet crée
         $maFormationSession->save();
         //Formation et les réf pedago lié sont crée, on retoure au listing
         header("Location: index.php?c=FormationSession");
     }
     //On transmet via setDatas() la collection de formation dans un tableau associatif
     Template::getInstance()->setFileName("FormationSession/edit_formationsession")->setDatas(array('maFormationSession' => $maFormationSession, 'coll_for' => $coll_for))->render();
 }
開發者ID:jayjaydelac,項目名稱:test,代碼行數:28,代碼來源:FormationSessionController.php

示例4: fetch

 /**
 +----------------------------------------------------------
 * 渲染模板輸出
 +----------------------------------------------------------
 * @access public
 +----------------------------------------------------------
 * @param string $templateFile 模板文件名
 * @param array $var 模板變量
 +----------------------------------------------------------
 * @return void
 +----------------------------------------------------------
 */
 public function fetch($templateFile, $_var)
 {
     $template_dir = dirname($templateFile) . DIRECTORY_SEPARATOR;
     vendor('TpcTemplate.template#class');
     if (C('TMPL_ENGINE_CONFIG')) {
         $config = C('TMPL_ENGINE_CONFIG');
         $options = array();
         foreach ($config as $key => $val) {
             $options[$key] = $val;
         }
         unset($config);
     } else {
         $options = array('template_dir' => TMPL_PATH, 'cache_dir' => CACHE_PATH, 'auto_update' => true, 'cache_lifetime' => 0, 'suffix' => '.html');
     }
     if (is_dir($template_dir)) {
         $options['template_dir'] = $template_dir;
     }
     $template = Template::getInstance();
     //使用單件模式實例化模板類
     $template->setOptions($options);
     //設置模板參數
     unset($template_dir);
     extract($_var);
     if (is_file($templateFile)) {
         include $template->getfile(basename($templateFile, $options['suffix']));
     } else {
         include $template->getfile(basename($template_dir . $templateFile, $options['suffix']));
     }
 }
開發者ID:yunsite,項目名稱:tp-coupon,代碼行數:41,代碼來源:TemplateTpc.class.php

示例5: smarty_function_widget

/**
 * This method will get a module/action or module template result
 * 
 * @param array $params     
 * @param Smarty $smarty 
 */
function smarty_function_widget($params, &$smarty)
{
    if (!isset($params['module']) || !isset($params['action']) && !isset($params['template']) || isset($params['action']) && isset($params['template'])) {
        throw new SmartyException('{widget} : module and action (or template) parameters must be defined');
    }
    $args = array();
    if (count($params) > 2) {
        foreach ($params as $k => $v) {
            if ($k !== 'module' && $k !== 'action' && $k !== 'template') {
                $args[$k] = $v;
            }
        }
    }
    if (isset($params['action'])) {
        Controller::getInstance()->setModule($params['module'])->setAction($params['action'])->setArgs(array($args))->dispatch();
    } else {
        if ($file = get_module_file($params['module'], 'template/' . $params['template'], true)) {
            $tpl = Template::getInstance($file);
            foreach ($smarty->tpl_vars as $k => $v) {
                if ($k !== 'SCRIPT_NAME' && $k !== 'smarty' && !isset($args[$k])) {
                    $args[$k] = $v->value;
                }
            }
            if (empty($args)) {
                return $tpl->get();
            }
            foreach ($args as $name => $value) {
                $tpl->assign($name, $value);
            }
            return $tpl->get();
        }
    }
}
開發者ID:salomalo,項目名稱:php-oxygen,代碼行數:39,代碼來源:function.widget.php

示例6: showBan

    public function showBan()
    {
        Factory::getUser()->authorise("admin", ResponseRegistery::getInstance()->site_id);
        $db = Factory::getDBO();
        if ($search) {
            $where = " AND  blog.title LIKE '%{$search}%' or sub.sub_domain='{$search}' ";
        }
        $tmpl = Template::getInstance('adminDashboard.tpl');
        $pg = $tmpl->initPagination();
        $start = $pg->getCurrentIndex();
        $limit = $pg->getLimit();
        $sql = 'SELECT
		    blog.title as title,
		    sub.sub_domain,
		    blog.site_id,
		    max(post.`date`)as lastpost,
		    site.active as active
		  FROM wb_weblogs as blog
		  JOIN ge_sites as site
		    ON(blog.site_id=site.id)
		  JOIN ge_subdomains as sub
		    ON(sub.site_id=sub.site_id)
		  left JOIN wb_articles as post
		    ON(post.weblog_id=blog.id)
		  WHERE site.active=0
		  ' . $where . '
		  group by blog.site_id
		  LIMIT ' . "{$start},{$limit}";
        $list = $db->query($sql)->fetchAll();
        $tmpl->loadPage('listblog');
        $tmpl->assign('list', $list);
        $this->reponse->setTitle('لیست وبلاگ‌ها');
        $this->reponse->setTemplate($tmpl);
    }
開發者ID:redknight,項目名稱:frot,代碼行數:34,代碼來源:AdminBlogService.php

示例7: showSystemStatus

 /**
  * 
  * 	Systemstatus anzeigen
  * 
  */
 public function showSystemStatus($ErrorString = "", $StatusString = "")
 {
     //if(!Controler_Main::getInstance()->isUserLoggedIn())//if( $this->User->getUserLevel() < BACKEND_USERLEVEL )
     if (Controler_Main::getInstance()->getUserLevel() < BACKEND_USERLEVEL) {
         $ControlerStart = new Controler_Start();
         $ControlerStart->start();
         return false;
     }
     $Request = new Request();
     /*
     $SystemInformationFinder= new SystemInformationFinder();
     $MySql = $SystemInformationFinder->mysqlVersion();
     $MySqlVersion = $MySql[0]['s_MySqlVersion'];
     */
     $PHPVersion = phpversion();
     $WebserverVersion = $_SERVER['SERVER_SOFTWARE'];
     $WebserverVersion = "<div class='befehlskontainer' >" . str_replace(" ", "</div><div class='befehlskontainer' >", $WebserverVersion) . "</div>";
     $WebserverConfig = "<div class='befehlskontainer' >:T_SERVER_NAME:: " . $_SERVER['SERVER_NAME'] . "</div><div class='befehlskontainer' >";
     $WebserverConfig .= ":T_SERVER_ADDR:: " . $_SERVER['SERVER_ADDR'] . "</div><div class='befehlskontainer' >";
     $WebserverConfig .= ":T_SERVER_PORT:: " . $_SERVER['SERVER_PORT'] . "</div><div class='befehlskontainer' >";
     $WebserverConfig .= ":T_REMOTE_ADDR:: " . $_SERVER['REMOTE_ADDR'] . "</div><div class='befehlskontainer' >";
     $WebserverConfig .= ":T_DOCUMENT_ROOT:: " . $_SERVER['DOCUMENT_ROOT'] . "</div><div class='befehlskontainer' >";
     $WebserverConfig .= ":T_SERVER_ADMIN:: " . $_SERVER['SERVER_ADMIN'] . "</div>";
     $Template = Template::getInstance("tpl_BE_SystemStatus.php");
     $Template->assign("UserId", Controler_Main::getInstance()->getUser()->getId());
     $Template->assign("WebserverConfig", $WebserverConfig);
     $Template->assign("WebserverVersion", $WebserverVersion);
     $Template->assign("PHPVersion", $PHPVersion);
     $Template->assign("MySqlVersion", mysql_get_server_info());
     $Template->assign("MySqlClientInfo", mysql_get_client_info());
     $Template->assign("MySqlProtInfo", mysql_get_proto_info());
     $Template->assign("MySqlHostInfo", mysql_get_host_info());
     $Template->render();
 }
開發者ID:0xF3ERROR,項目名稱:Home-Control,代碼行數:39,代碼來源:cls_Controler_Backend.php

示例8: __construct

 function __construct($model_name, $method = 'post', $action = null)
 {
     $this->model_name = $model_name;
     $this->method = $method;
     $this->action = $action;
     $this->schema = new Schema($model_name);
     $this->template = Template::getInstance();
 }
開發者ID:rev087,項目名稱:kennel,代碼行數:8,代碼來源:ModelForm.php

示例9: generate

 public function generate()
 {
     if ($this->inline) {
         return Template::getInstance()->get('form_panel_inline', $this->getData());
     } else {
         return Template::getInstance()->get('form_panel', $this->getData());
     }
 }
開發者ID:Ashaan,項目名稱:sygil-framework,代碼行數:8,代碼來源:panel.php

示例10: __construct

 /**
  * 架構函數
  * @access public
  */
 public function __construct()
 {
     $this->tagLib = strtolower(substr(get_class($this), 6));
     $this->tpl = Template::getInstance();
     //ThinkTemplate::getInstance();
     $this->_initialize();
     $this->load();
 }
開發者ID:yang7hua,項目名稱:hunshe,代碼行數:12,代碼來源:TagLib.class.php

示例11: generate

 public function generate()
 {
     $content = '';
     foreach ($this->content as $menu) {
         $content .= $menu->generate();
     }
     $data = array('__BLOCK__' => $content);
     return Template::getInstance()->get('slide', $data, 'org.sygil.slide.block');
 }
開發者ID:Ashaan,項目名稱:sygil-framework,代碼行數:9,代碼來源:slide.php

示例12: generate

 public function generate()
 {
     $style = '';
     if ($this->background) {
         $style .= 'background:' . $this->background . ';';
     }
     $data = array('__ID__' => $this->id, '__CONTENT__' => $this->content, '__STYLE__' => $style);
     return Template::getInstance()->get('line', $data, 'org.sygil.base.panel');
 }
開發者ID:Ashaan,項目名稱:sygil-framework,代碼行數:9,代碼來源:line.php

示例13: generate

 public function generate()
 {
     $content = '';
     foreach ($this->content as $menu) {
         $content .= $menu->generate();
     }
     $data = array('__TITLE__' => $this->title, '__CONTENT__' => $content, '__STYLE__' => $this->active ? 'display:block;' : 'display:none;', '__ID__' => $this->id);
     return Template::getInstance()->get('block', $data, 'org.sygil.menu.block');
 }
開發者ID:Ashaan,項目名稱:sygil-framework,代碼行數:9,代碼來源:block.php

示例14: aviators_templates_init

function aviators_templates_init()
{
    $clear = aviators_settings_get_value('templates', 'cache', 'clear');
    $debug = aviators_settings_get_value('templates', 'cache', 'debug');
    if ($clear == 'on') {
        $instance = Template::getInstance();
        $instance->clearCacheFiles();
        update_option('templates_cache_clear', FALSE);
    }
}
開發者ID:dongchpp,項目名稱:BIPHP,代碼行數:10,代碼來源:templates.php

示例15: showList

 public function showList()
 {
     Factory::getUser()->authorise("template", ResponseRegistery::getInstance()->site_id);
     $db = Factory::getDBO();
     $list = $db->SimpleSelect("ge_default_templates", "id,image,name")->fetchAll();
     $tmpl = Template::getInstance('userDashboard.tpl');
     $tmpl->loadPage('list_template');
     $tmpl->assign('list', $list);
     $this->reponse->setTitle('لیست قالب ها');
     $this->reponse->setTemplate($tmpl);
 }
開發者ID:redknight,項目名稱:frot,代碼行數:11,代碼來源:DashboardTemplateService.php


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