当前位置: 首页>>代码示例>>PHP>>正文


PHP Smarty::__construct方法代码示例

本文整理汇总了PHP中Smarty::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Smarty::__construct方法的具体用法?PHP Smarty::__construct怎么用?PHP Smarty::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Smarty的用法示例。


在下文中一共展示了Smarty::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Construct
  */
 public function __construct()
 {
     parent::__construct();
     $this->JSRMS = new JSRMS();
     $this->JSRMS->requireResource('system');
     $this->muteExpectedErrors();
     $this->setCacheDir(SYSTEM_ROOT . '/classes/smarty/cache/');
     $this->setCompileDir(SYSTEM_ROOT . '/classes/smarty/templates_c/');
     $this->setTemplateDir(SYSTEM_ROOT . '/view/');
     $this->registerObject('Router', Router::getInstance(), array('build'), false);
     $this->registerObject('L10N', System::getLanguage(), array('_'), false);
     $this->assign('LoggedIn', System::getUser() != NULL);
     $this->assign('User', System::getUser());
     $this->assign('Navigation', Navigation::$elements);
     $this->assign('LangStrings', System::getLanguage()->getAllStrings());
     // Configuration
     $this->assign('HTTP_BASEDIR', System::getBaseURL());
     $this->assign('MOD_REWRITE', MOD_REWRITE);
     $this->assign('MAX_UPLOAD_SIZE', Utils::maxUploadSize());
     if (System::getSession()->getData('successMsg', '') != '') {
         $this->assign('successMsg', System::getSession()->getData('successMsg', ''));
         System::getSession()->setData('successMsg', '');
     }
     if (System::getSession()->getData('errorMsg', '') != '') {
         $this->assign('errorMsg', System::getSession()->getData('errorMsg', ''));
         System::getSession()->setData('errorMsg', '');
     }
     if (System::getSession()->getData('infoMsg', '') != '') {
         $this->assign('infoMsg', System::getSession()->getData('infoMsg', ''));
         System::getSession()->setData('infoMsg', '');
     }
 }
开发者ID:nicefirework,项目名称:sharecloud,代码行数:35,代码来源:Template.class.php

示例2: array

 function Smarty_Serweb()
 {
     global $config, $_SERWEB;
     // Smarty does not support "magic_quotes_runtime" enabled
     // So make sure to disable it.
     ini_set("magic_quotes_runtime", 0);
     // Class Constructor. These automatically get set with each new instance.
     parent::__construct();
     //set smarty directories
     $this->template_dir = array($_SERWEB["templatesdir"]);
     if ($_SERWEB["templatesdir"] != $_SERWEB["coretemplatesdir"]) {
         $this->template_dir[] = $_SERWEB["coretemplatesdir"];
     }
     $this->config_dir = $_SERWEB["templatesdir"] . 'configs/';
     $this->cache_dir = $_SERWEB["templatesdir"] . 'cache/';
     $this->plugins_dir = array();
     if (!empty($_SERWEB["smartypluginsdir"])) {
         $this->plugins_dir[] = $_SERWEB["smartypluginsdir"];
     }
     $this->plugins_dir[] = $_SERWEB["corefunctionsdir"] . "smarty_plugins/";
     $this->plugins_dir[] = $_SERWEB["smartydir"] . "plugins/";
     if (!empty($config->smarty_compile_dir)) {
         RecursiveMkdir($config->smarty_compile_dir);
         $this->compile_dir = $config->smarty_compile_dir;
     } else {
         $this->compile_dir = $_SERWEB["templatesdir"] . 'templates_c/';
     }
 }
开发者ID:BackupTheBerlios,项目名称:serweb-frmwrk,代码行数:28,代码来源:smarty_serweb.php

示例3: __construct

 public function __construct()
 {
     parent::__construct();
     if (!file_exists(SUGAR_SMARTY_DIR)) {
         mkdir_recursive(SUGAR_SMARTY_DIR, true);
     }
     if (!file_exists(SUGAR_SMARTY_DIR . 'templates_c')) {
         mkdir_recursive(SUGAR_SMARTY_DIR . 'templates_c', true);
     }
     if (!file_exists(SUGAR_SMARTY_DIR . 'configs')) {
         mkdir_recursive(SUGAR_SMARTY_DIR . 'configs', true);
     }
     if (!file_exists(SUGAR_SMARTY_DIR . 'cache')) {
         mkdir_recursive(SUGAR_SMARTY_DIR . 'cache', true);
     }
     $this->template_dir = '.';
     $this->compile_dir = SUGAR_SMARTY_DIR . 'templates_c';
     $this->config_dir = SUGAR_SMARTY_DIR . 'configs';
     $this->cache_dir = SUGAR_SMARTY_DIR . 'cache';
     $this->request_use_auto_globals = true;
     // to disable Smarty from using long arrays
     if (file_exists('custom/include/Smarty/plugins')) {
         $plugins_dir[] = 'custom/include/Smarty/plugins';
     }
     $plugins_dir[] = 'include/Smarty/plugins';
     $this->plugins_dir = $plugins_dir;
     $this->assign("VERSION_MARK", getVersionedPath(''));
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:28,代码来源:Sugar_Smarty.php

示例4: __construct

 /**
  * [__construct 构造方法自动运行]
  */
 public function __construct()
 {
     parent::__construct();
     $this->setTemplateDir($this->template_dir);
     $this->setCompileDir($this->compile_dir);
     // $this->caching = Smarty::CACHING_LIFETIME_CURRENT;
 }
开发者ID:neilchou,项目名称:phpbase,代码行数:10,代码来源:MySmarty.php

示例5: __construct

 public function __construct()
 {
     parent::__construct();
     $this->addTemplateDir(CFG_dir . 'p/tpl/');
     $this->compile_dir = CFG_dir . 'tmp/tpl_c';
     $this->plugins_dir = CFG_dir . 'p/libs/plugins/';
 }
开发者ID:Alambos,项目名称:fullserver,代码行数:7,代码来源:Szablon.class.php

示例6: __construct

 public function __construct()
 {
     // Class Constructor. These automatically get set with each new instance.
     parent::__construct();
     // call the objects initialization parameters
     self::setParams();
 }
开发者ID:rustyx,项目名称:Serendipity,代码行数:7,代码来源:serendipity_smarty_class.inc.php

示例7: __construct

 public function __construct($smConf = array(), $filter = true)
 {
     parent::__construct();
     if (count($smConf) == 0) {
         $smConf = Piwik_Config::getInstance()->smarty;
     }
     foreach ($smConf as $key => $value) {
         $this->{$key} = $value;
     }
     $this->template_dir = $smConf['template_dir'];
     array_walk($this->template_dir, array("Piwik_Smarty", "addPiwikPath"), PIWIK_INCLUDE_PATH);
     $this->plugins_dir = $smConf['plugins_dir'];
     array_walk($this->plugins_dir, array("Piwik_Smarty", "addPiwikPath"), PIWIK_INCLUDE_PATH);
     $this->compile_dir = $smConf['compile_dir'];
     Piwik_Smarty::addPiwikPath($this->compile_dir, null, PIWIK_USER_PATH);
     $this->cache_dir = $smConf['cache_dir'];
     Piwik_Smarty::addPiwikPath($this->cache_dir, null, PIWIK_USER_PATH);
     $error_reporting = $smConf['error_reporting'];
     if ($error_reporting != (string) (int) $error_reporting) {
         $error_reporting = self::bitwise_eval($error_reporting);
     }
     $this->error_reporting = $error_reporting;
     if ($filter) {
         $this->load_filter('output', 'cachebuster');
         $use_ajax_cdn = Piwik_Config::getInstance()->General['use_ajax_cdn'];
         if ($use_ajax_cdn) {
             $this->load_filter('output', 'ajaxcdn');
         }
         $this->load_filter('output', 'trimwhitespace');
     }
 }
开发者ID:nnnnathann,项目名称:piwik,代码行数:31,代码来源:Smarty.php

示例8:

 function __construct($root = ".")
 {
     parent::__construct();
     if (!empty($root)) {
         $this->Init($root);
     }
 }
开发者ID:jbaicoianu,项目名称:elation,代码行数:7,代码来源:templatemanager_class.php

示例9: __construct

 public function __construct(Request $peticion, Acl $_acl)
 {
     parent::__construct();
     $this->_controlador = $peticion->getControlador();
     $this->_js = array();
     $this->_acl = $_acl;
 }
开发者ID:AndresSalazarMarin,项目名称:GAIA-Integrador,代码行数:7,代码来源:View.php

示例10: __construct

 /**
  * Constructor. Inherits all methods from Smarty.
  */
 public function __construct()
 {
     parent::__construct();
     // Paths definition:
     $templates_path = ROOT_PATH . '/instances/' . Bootstrap::$instance . '/templates/';
     $this->setTemplateDir(ROOT_PATH . '/');
     // The templates are taken using the templates.config.php mappings, under the variable $_tpls.
     $this->setCompileDir($templates_path . '_smarty/compile/');
     $this->setConfigDir($templates_path . '_smarty/configs/');
     $this->setCacheDir($templates_path . '_smarty/cache/');
     // Get the instances inheritance.
     $instance_inheritance = \Sifo\Domains::getInstance()->getInstanceInheritance();
     // If there is inheritance.
     if (is_array($instance_inheritance)) {
         // First the child instance, last the parent instance.
         $instance_inheritance = array_reverse($instance_inheritance);
         foreach ($instance_inheritance as $current_instance) {
             $this->addPluginsDir(ROOT_PATH . '/instances/' . $current_instance . '/templates/' . '_smarty/plugins');
         }
     } else {
         $this->addPluginsDir($templates_path . '_smarty/plugins');
     }
     // Last path is the default smarty plugins directory.
     $this->addPluginsDir(ROOT_PATH . '/libs/Smarty-sifo-plugins');
     // Set this to false to avoid magical parsing of literal blocks without the {literal} tags.
     $this->auto_literal = false;
 }
开发者ID:ninodafonte,项目名称:SIFO,代码行数:30,代码来源:View.php

示例11: __construct

    public function __construct()
    {
        parent::__construct();

        // Store the Codeigniter super global instance... whatever
        $this->CI = get_instance();

//        $this->CI->load->config('smarty');
//
//        $this->template_dir      = $this->CI->config->item('template_directory');
//        $this->compile_dir       = $this->CI->config->item('compile_directory');
//        $this->cache_dir         = $this->CI->config->item('cache_directory');
//        $this->config_dir        = $this->CI->config->item('config_directory');
//        $this->template_ext      = $this->CI->config->item('template_ext');

        $this->template_dir      = $this->CI->config->item('template_dir');
        $this->compile_dir       = $this->CI->config->item('compile_dir');
        $this->cache_dir         = $this->CI->config->item('cache_dir');
        $this->config_dir        = $this->CI->config->item('config_dir');
        $this->template_ext      = $this->CI->config->item('template_ext');
        $this->exception_handler = null;

        // Add all helpers to plugins_dir
        $helpers = glob(APPPATH . 'helpers/', GLOB_ONLYDIR | GLOB_MARK);

        foreach ($helpers as $helper)
        {
            $this->plugins_dir[] = $helper;
        }
        
        // Should let us access Codeigniter stuff in views
        $this->assign("this", $this->CI);

    }
开发者ID:robinmin,项目名称:MyContact,代码行数:34,代码来源:Smarty.php

示例12: __construct

 public function __construct()
 {
     parent::__construct();
     $ds = '/';
     $module = MODULE_NAME;
     $leftDelimiter = \Pandaphp::shell('Config::get', 'template_smarty_left_delimiter');
     $this->left_delimiter = $leftDelimiter;
     $rightDelimiter = \Pandaphp::shell('Config::get', 'template_smarty_right_delimiter');
     $this->right_delimiter = $rightDelimiter;
     // 设置模板文件目录
     $viewDirname = \Pandaphp::shell('Config::get', 'dirname_view');
     $theme = \Pandaphp::shell('Config::get', 'template_theme');
     $theme = $theme ? $theme . $ds : '';
     $templateDir = \Pandaphp::get('appPath') . $module . $ds . $viewDirname . $ds . $theme;
     $this->setTemplateDir($templateDir);
     // 设置编译后的模板文件目录]
     $runtimeDir = \Pandaphp::get('runtimePath');
     $compileDir = $runtimeDir . $module . $ds . 'template_complie' . $ds;
     $this->setCompileDir($compileDir);
     // 设置缓存的模板文件目录
     $cacheDir = $runtimeDir . $module . $ds . 'template_cache' . $ds;
     $this->setCacheDir($cacheDir);
     $isTemplateCache = \Pandaphp::shell('Config::get', 'template_cache_on');
     $this->setCaching($isTemplateCache);
     $templateCacheLifetime = \Pandaphp::shell('Config::get', 'template_cache_lifetime');
     $this->setCacheLifetime($templateCacheLifetime);
 }
开发者ID:songdent,项目名称:pandaphp,代码行数:27,代码来源:SmartyView.php

示例13: __construct

 public function __construct()
 {
     parent::__construct();
     // It is not recommended to put these directories under the web server document root
     $this->setTemplateDir(DOCUMENT_ROOT . '/view/templates/');
     $this->setCompileDir(DOCUMENT_ROOT . '/view/templates_c/');
     $this->setCacheDir(DOCUMENT_ROOT . '/view/cache/');
     $this->setConfigDir(DOCUMENT_ROOT . '/view/configs/');
     $this->configLoad('paths.conf');
     $this->compile_check = false;
     // put to false for maximal performance when it is into production
     $this->force_compile = false;
     // should never be used in a production environment
     $this->debugging = false;
     //$this->debugging_ctrl = ($_SERVER['SERVER_NAME'] == 'localhost')
     $this->caching = 0;
     $this->cache_lifetime = 0;
     // Delimiters in HTML codes
     $this->left_delimiter = '{';
     $this->right_delimiter = '}';
     // Delimiters in JavaScript codes
     //$this->left_delimiter = '<!--{';
     //$this->right_delimiter = '}-->';
     $this->assign('app_name', 'HEHLan');
 }
开发者ID:HehLan,项目名称:Intranet-5.0,代码行数:25,代码来源:Smarty_HEHLan.class.php

示例14: array

 /**
  * needs a proper description
  * @param string $tikidomain
  */
 function Smarty_Tiki($tikidomain = '')
 {
     parent::__construct();
     global $prefs, $style_base;
     $this->initializePaths();
     $this->setConfigDir(null);
     if (!isset($prefs['smarty_compilation'])) {
         $prefs['smarty_compilation'] = '';
     }
     $this->compile_check = $prefs['smarty_compilation'] != 'never';
     $this->force_compile = $prefs['smarty_compilation'] == 'always';
     $this->assign('app_name', 'Tiki');
     $this->setPluginsDir(array(TIKI_SMARTY_DIR, SMARTY_DIR . 'plugins'));
     if (!isset($prefs['smarty_security']) || $prefs['smarty_security'] == 'y') {
         $this->enableSecurity('Tiki_Security_Policy');
     } else {
         $this->disableSecurity();
     }
     $this->use_sub_dirs = false;
     $this->url_overriding_prefix_stack = array();
     if (!empty($prefs['smarty_notice_reporting']) and $prefs['smarty_notice_reporting'] === 'y') {
         $this->error_reporting = E_ALL;
     } else {
         $this->error_reporting = E_ALL ^ E_NOTICE;
     }
     $this->setCompileDir(realpath("templates_c"));
 }
开发者ID:hurcane,项目名称:tiki-azure,代码行数:31,代码来源:smarty.php

示例15: __construct

 /**
  * Constructor
  * @param 	string	$template [optional] : name of the template to load (without the .tpl)
  * @param 	array	$info [optional default Array()] : array containing page's meta informations, title, cache, cache_version, etc...
  * 					cach_lifetime : false or 0 to disactivate caching, null for default, or int to set cache lifetime
  * 					Set cache_version if you want to separate cache into versions
  */
 public function __construct($template = false, $info = array())
 {
     BF::register_error_output_callback(array($this, "show_error"));
     // > Define runtime variables
     parent::__construct();
     $this->compile_check = BF::gc('template_compile_check');
     $this->debugging = BF::gc('template_smarty_debug');
     $this->template_dir = BF::gf('tpl')->path();
     $this->compile_dir = BF::gf('compiled')->path();
     $this->cache_dir = BF::gf('cached')->path();
     $this->addPluginsDir(BF::gf('tags')->path());
     $this->content_type = BF::gc('template_default_content_type');
     $this->error_reporting = BF::gc('error_reporting');
     // > Caching
     // block for non-cachable content
     $this->cache_lifetime = BF::gc('template_cache_lifetime');
     $this->caching = BF::gc('template_cache') ? 1 : 0;
     //$this->cache_version = null;
     // > Register template infos
     $this->data = array();
     $this->assignByRef("_data", $this->data);
     // > Register common template functions and blocks. Others will be found in the tags dir
     $this->loadFilter('pre', 'translate');
     // trim top and bottom
     $this->registerFilter("output", create_function('$x', 'return trim($x);'));
     if ($template !== false) {
         $this->load($template, $info);
     }
 }
开发者ID:laiello,项目名称:phpbf,代码行数:36,代码来源:BF_output_template.php


注:本文中的Smarty::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。