Source for file Smarty4Maple.php
Documentation is available at Smarty4Maple.php
* Teeple2 - PHP5 Web Application Framework inspired by Seasar2
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
* @author Mitsutaka Sato <miztaka@gmail.com>
* @license http://www.php.net/license/3_0.txt PHP License 3.0
require_once SMARTY_DIR .
"Smarty.class.php";
* Smarty4MapleクラスはSingletonとして使うので直接newしてはいけない
'VIEW_TEMPLATE_DIR' =>
'template_dir',
'VIEW_COMPILE_DIR' =>
'compile_dir',
'VIEW_CONFIG_DIR' =>
'config_dir',
'VIEW_CACHE_DIR' =>
'cache_dir',
'SMARTY_TEMPLATE_DIR' =>
'template_dir',
'SMARTY_COMPILE_DIR' =>
'compile_dir',
'SMARTY_CONFIG_DIR' =>
'config_dir',
'SMARTY_CACHE_DIR' =>
'cache_dir',
'SMARTY_CACHING' =>
'caching',
'SMARTY_CACHE_LIFETIME' =>
'cache_lifetime',
'SMARTY_COMPILE_CHECK' =>
'compile_check',
'SMARTY_FORCE_COMPILE' =>
'force_compile',
'SMARTY_LEFT_DELIMITER' =>
'left_delimiter',
'SMARTY_RIGHT_DELIMITER' =>
'right_delimiter'
foreach($constants as $constName =>
$attr) {
if(defined('SMARTY_DEFAULT_MODIFIERS')) {
$this->default_modifiers =
array(SMARTY_DEFAULT_MODIFIERS);
if (defined('SMARTY_PULGINS_DIR')) {
array_push($this->plugins_dir, SMARTY_PULGINS_DIR);
$this->_registerFilters();
* Smarty4Mapleクラスの唯一のインスタンスを返却
* @return Teeple_Smarty4Maple
if ($instance ===
NULL) {
foreach($opts as $attr =>
$value) {
$instance->$attr =
$value;
private function _registerFilters() {
if (TEMPLATE_CODE !=
INTERNAL_CODE) {
$this->register_prefilter('smarty4maple_prefilter');
if (OUTPUT_CODE !=
INTERNAL_CODE) {
$this->register_outputfilter('smarty4maple_outputfilter');
$result =
$this->clear_compiled_tpl();
* @param string $tpl テンプレート名
$result =
$this->clear_cache($tpl);
* @param Teeple_ActionBase $action Actionのインスタンス
$this->assign('a', $action);
* @param Teeple_Token $token Tokenのインスタンス
$this->register_object("token", $token);
$this->assign('token', array(
'name' =>
$token->getName(),
'value' =>
$token->getValue(),
* @param Teeple_Session $session Sessionのインスタンス
$this->assign('s', $session);
* @param Teeple_Request $request Requestのインスタンス
$this->assign('r', $request);
* @param string $scriptName ScriptName
$this->assign('scriptName', $scriptName);