本文整理汇总了PHP中Smarty::Smarty方法的典型用法代码示例。如果您正苦于以下问题:PHP Smarty::Smarty方法的具体用法?PHP Smarty::Smarty怎么用?PHP Smarty::Smarty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Smarty
的用法示例。
在下文中一共展示了Smarty::Smarty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Overwrite template directory path if Smarty is used by a module
*/
public function __construct($module = '')
{
if ($module != '') {
$this->template_dir = 'modules/' . $module . '/templates';
}
parent::Smarty();
}
示例2: bBlog
function bBlog()
{
// connect to database
$this->_adb = NewADOConnection('mysql://' . DB_USERNAME . ':' . DB_PASSWORD . '@' . DB_HOST . '/' . DB_DATABASE . '?persist');
//$this->_db = new db(DB_USERNAME, DB_PASSWORD, DB_DATABASE, DB_HOST);
$this->num_rows =& $this->_db->num_rows;
$this->insert_id =& $this->_db->insert_id;
//Load the config
$config =& new configHandler($this->_adb);
$config->loadConfig();
$this->assign('blogname', C_BLOGNAME);
$this->assign('blogdescription', C_BLOG_DESCRIPTION);
$this->assign('blogurl', BLOGURL);
$this->assign('bblogurl', BBLOGURL);
$this->assign('metakeywords', C_META_KEYWORDS);
$this->assign('metadescription', C_META_DESCRIPTION);
$this->assign('charset', C_CHARSET);
$this->assign('direction', C_DIRECTION);
$this->assign('C_CAPTCHA_ENABLE', C_CAPTCHA_ENABLE);
// initial time from config table, based on last updated stuff.
// this is just the initial value.
//$this->lastmodified = C_LAST_MODIFIED;
//$this->register_postfilter("update_when_compiled");
// load up the sections
$this->get_sections();
//start the session that we need so much ;)
if (!session_id()) {
session_start();
}
$this->_ph =& new postHandler(&$this->_adb);
Smarty::Smarty();
}
示例3: XSmarty
function XSmarty()
{
$this->compile_dir = URLLOCAL . 'classes_ext/smarty/templates_c';
$this->cache_dir = URLLOCAL . 'classes_ext/smarty/cache';
$this->config_dir = URLLOCAL . 'classes_ext/smarty/config_smarty';
Smarty::Smarty();
}
示例4: TemplateEngine
/**
* Constructor
* initialize the smarty template engine
*
* @param string template
*/
function TemplateEngine($template, $p_theme = THEME_DEFAULT)
{
if (!defined('THEME')) {
//define('THEME', THEME_DEFAULT);
define('THEME', $p_theme);
}
$templateSet = THEME;
parent::Smarty();
$this->template_dir = array(INCLUDE_PATH . '/themes/' . $templateSet . '/', INCLUDE_PATH . '/themes/' . THEME_DEFAULT . '/', PLUGINS_PATH);
$this->compile_dir = INCLUDE_PATH . '/datas/tpl_compiled/';
$this->cache_dir = INCLUDE_PATH . '/datas/cache_smarty/';
$this->config_dir = INCLUDE_PATH . '/themes/' . $templateSet . '/smarty_config/';
$this->plugins_dir = array(INCLUDE_PATH . '/libs/smarty/plugins', INCLUDE_PATH . '/core/include/smarty_plugins');
$this->cache_lifetime = CACHE_SMARTY;
$this->compile_id = $templateSet . PHPMV_VERSION . INTERNAL_STATS;
if (defined('SMARTY_DEBUG') && SMARTY_DEBUG) {
$this->caching = 0;
$this->force_compile = 1;
$this->compile_check = 1;
} else {
$this->caching = 1;
$this->force_compile = 0;
$this->compile_check = 0;
$this->load_filter('output', 'trimwhitespace');
}
$this->clear_all_cache(CACHE_SMARTY);
if (mt_rand(0, 5000) === 0) {
$this->clear_all_cache();
}
$this->setTemplate($template);
}
示例5:
function CI_Smarty()
{
parent::Smarty();
$this->compile_dir = APPPATH . "cache/templates_c";
$this->template_dir = APPPATH . "views/templates";
$this->assign('APPPATH', APPPATH);
$this->assign('BASEPATH', BASEPATH);
}
示例6:
function CI_Smarty()
{
parent::Smarty();
$this->compile_dir = APPPATH . "views/templates_c";
$this->template_dir = APPPATH . "views/templates";
$this->assign('APPPATH', APPPATH);
$this->assign('BASEPATH', BASEPATH);
log_message('debug', "Smarty Class Initialized");
}
示例7:
/**
* class constructor
*
* @access public
*/
function __construct()
{
// call parent class
parent::Smarty();
// use application cache folder
$this->cache_dir = APPDIR . 'cache/';
// use application view folder
$this->template_dir = APPDIR . 'views/';
}
示例8: __construct
public function __construct($name, $panelName = '')
{
Smarty::Smarty();
$this->name = $name;
$this->panelName = $panelName;
$this->default_resource_type = 'template';
$this->security = true;
Gpf_Plugins_Engine::extensionPoint('Core.initSmarty', $this);
}
示例9:
function __construct()
{
parent::Smarty();
$this->compile_dir = $this->smartydir . "templates_c/";
$this->config_dir = $this->smartydir . "configs/";
$this->cache_dir = $this->smartydir . "cache/";
$this->caching = true;
$this->force_compile = false;
$this->template_dir = APP_TMVC_DIR . "/myapp/views/";
}
示例10: array
function Smarty_parser($config = array())
{
parent::Smarty();
if (count($config) > 0) {
$this->initialize($config);
}
// register Smarty resource named "ci"
$this->register_resource("ci", array($this, "ci_get_template", "ci_get_timestamp", "ci_get_secure", "ci_get_trusted"));
log_message('debug', "Smarty_parser Class Initialized");
}
示例11: __construct
public function __construct()
{
// Вызов конструктораSmarty
parent::Smarty();
// Меняем папки шаблонов по умолчанию
$this->template_dir = TEMPLATE_DIR;
$this->compile_dir = COMPILE_DIR;
$this->config_dir = CONFIG_DIR;
$this->plugins_dir[0] = SMARTY_DIR . 'plugins';
$this->plugins_dir[1] = PRESENTATION_DIR . 'smarty_plugins';
}
示例12: installbase
/**
* Performs basic setup and then calls __init
*
* Note that all data received via $_POST have magic quotes removed.
*/
function installbase()
{
stringHandler::removeMagicQuotes($_POST);
Smarty::Smarty();
$this->_steps = array('prescan', 'install', 'postscan', 'upgrade');
$this->assign('version', LOQ_CUR_VERSION);
$this->template_dir = LOQ_INSTALLER . '/templates';
$this->setCompileDir();
$this->loadconfiguration();
$this->__init();
}
示例13:
function CI_Smarty()
{
parent::Smarty();
$this->template_dir = APPPATH . "views/";
$this->compile_dir = "saemc://smartycompiled/";
$this->cache_dir = "saemc://smartycache/";
$this->compile_locking = false;
$this->assign('APPPATH', APPPATH);
$this->assign('BASEPATH', BASEPATH);
log_message('debug', "Smarty Class Initialized");
}
示例14:
/**
* The class constructor.
*/
function __construct()
{
parent::Smarty();
if (file_exists(SMARTY_DIR . $this->compiler_file)) {
require_once SMARTY_DIR . $this->compiler_file;
} else {
// use include_path
require_once $this->compiler_file;
}
$this->compiler_file = "Smarty_CompilerExt.class.php";
$this->compiler_class = "Smarty_CompilerExt";
}
示例15: __construct
/**
* Override Smarty::__construct
*
* @return void
*/
public function __construct()
{
parent::Smarty();
/**
* Config some params
*/
$viewConfig = Vi_Registry::getConfig('viewConfig');
$viewConfig['template_dir'] = '';
foreach ($viewConfig as $key => $value) {
$this->{$key} = $value;
}
}