Source for file Ethna_Renderer_Smarty.php
Documentation is available at Ethna_Renderer_Smarty.php
// vim: foldmethod=marker
* Ethna_Renderer_Smarty.php
* @author Kazuhiro Hosoi <hosoi@gree.co.jp>
* @license http://www.opensource.org/licenses/bsd-license.php The BSD License
* @version $Id: Ethna_Renderer_Smarty.php 453 2007-01-17 18:38:51Z ichii386 $
require_once 'Smarty/Smarty.class.php';
require_once ETHNA_BASE .
'/class/Ethna_SmartyPlugin.php';
// {{{ Ethna_Renderer_Smarty
* Smartyレンダラクラス(Mojaviのまね)
* @author Kazuhiro Hosoi <hosoi@gree.co.jp>
/** @var string compile directory */
* Ethna_Renderer_Smartyクラスのコンストラクタ
parent::Ethna_Renderer($controller);
$this->engine =
& new Smarty;
$template_dir =
$controller->getTemplatedir();
$compile_dir =
$controller->getDirectory('template_c');
$this->setTemplateDir($template_dir);
$this->engine->template_dir =
$this->template_dir;
$this->engine->compile_id =
md5($this->template_dir);
if (is_dir($this->engine->compile_dir) ===
false) {
$this->engine->plugins_dir =
array_merge(array(SMARTY_DIR .
'plugins'),
$controller->getDirectory('plugins'));
$this->setPlugin('number_format','modifier','smarty_modifier_number_format');
$this->setPlugin('strftime','modifier','smarty_modifier_strftime');
$this->setPlugin('count','modifier','smarty_modifier_count');
$this->setPlugin('join','modifier','smarty_modifier_join');
$this->setPlugin('filter','modifier', 'smarty_modifier_filter');
$this->setPlugin('unique','modifier','smarty_modifier_unique');
$this->setPlugin('wordwrap_i18n','modifier','smarty_modifier_wordwrap_i18n');
$this->setPlugin('truncate_i18n','modifier','smarty_modifier_truncate_i18n');
$this->setPlugin('i18n','modifier','smarty_modifier_i18n');
$this->setPlugin('checkbox','modifier','smarty_modifier_checkbox');
$this->setPlugin('select','modifier','smarty_modifier_select');
$this->setPlugin('form_value','modifier','smarty_modifier_form_value');
$this->setPlugin('is_error','function','smarty_function_is_error');
$this->setPlugin('message','function','smarty_function_message');
$this->setPlugin('uniqid','function','smarty_function_uniqid');
$this->setPlugin('select','function','smarty_function_select');
$this->setPlugin('checkbox_list','function','smarty_function_checkbox_list');
$this->setPlugin('form_name','function','smarty_function_form_name');
$this->setPlugin('form_input','function','smarty_function_form_input');
$this->setPlugin('form_submit','function','smarty_function_form_submit');
$this->setPlugin('url','function','smarty_function_url');
$this->setPlugin('csrfid','function','smarty_function_csrfid');
$this->setPlugin('form','block','smarty_block_form');
* @param string $template テンプレート名
* @param bool $capture true ならば出力を表示せずに返す
function perform($template =
null, $capture =
false)
if ($template ===
null &&
$this->template ===
null) {
if ($template !==
null) {
$this->template =
$template;
||
is_readable($this->template_dir .
$this->template)) {
$captured =
$this->engine->fetch($this->template);
$this->engine->display($this->template);
* @param string $name 変数名
$property =
& $this->engine->get_template_vars($name);
if ($property !==
null) {
$this->engine->clear_assign($name);
$this->engine->assign($array);
$this->engine->assign_by_ref($array);
* @param string $name 変数名
$this->engine->assign($name, $value);
* @param string $name 変数名
$this->engine->assign_by_ref($name, $value);
* @param string $name プラグイン名
* @param string $type プラグインタイプ
* @param mixed $plugin プラグイン本体
$register_method =
'register_' .
$type;
if ($type ===
'prefilter' ||
$type ===
'postfilter' ||
$type ===
'outputfilter') {
parent::setPlugin($name, $type, $plugin);
$this->engine->$register_method($plugin);
parent::setPlugin($name, $type, $plugin);
$this->engine->$register_method($name, $plugin);
Documentation generated on Thu, 08 May 2008 00:15:26 +0900 by phpDocumentor 1.4.2