Changeset 22796 for branches/version-2_12-dev/data/class/SC_View.php
- Timestamp:
- 2013/05/02 18:11:36 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/SC_View.php
r22567 r22796 24 24 require_once realpath(dirname(__FILE__)) . '/../module/Smarty/libs/Smarty.class.php'; 25 25 26 class SC_View 27 { 26 class SC_View { 28 27 29 28 var $_smarty; … … 32 31 33 32 // コンストラクタ 34 function __construct() 35 { 33 function __construct() { 36 34 $this->init(); 37 35 } 38 36 39 function init() 40 { 37 function init() { 41 38 $this->_smarty = new Smarty; 42 39 $this->_smarty->left_delimiter = '<!--{'; … … 76 73 77 74 // テンプレートに値を割り当てる 78 function assign($val1, $val2) 79 { 75 function assign($val1, $val2) { 80 76 $this->_smarty->assign($val1, $val2); 81 77 } 82 78 83 79 // テンプレートの処理結果を取得 84 function fetch($template) 85 { 80 function fetch($template) { 86 81 return $this->_smarty->fetch($template); 87 82 } … … 94 89 * @return string 95 90 */ 96 function getResponse($template, $no_error = false) 97 { 91 function getResponse($template, $no_error = false) { 98 92 if (!$no_error) { 99 93 global $GLOBAL_ERR; … … 118 112 * @return void 119 113 */ 120 function setPage($objPage) 121 { 114 function setPage($objPage) { 122 115 $this->objPage = $objPage; 123 116 } … … 127 120 * @return void 128 121 */ 129 function registFilter() 130 { 122 function registFilter() { 131 123 $this->_smarty->register_prefilter(array(&$this, 'prefilter_transform')); 132 124 $this->_smarty->register_outputfilter(array(&$this, 'outputfilter_transform')); … … 139 131 * @return string $source ソース 140 132 */ 141 function prefilter_transform($source, &$smarty) 142 { 133 function prefilter_transform($source, &$smarty) { 143 134 if (!is_null($this->objPage)) { 144 135 // フックポイントを実行. … … 155 146 * @return string $source ソース 156 147 */ 157 function outputfilter_transform($source, &$smarty) 158 { 148 function outputfilter_transform($source, &$smarty) { 159 149 if (!is_null($this->objPage)) { 160 150 // フックポイントを実行. … … 166 156 167 157 // テンプレートの処理結果を表示 168 function display($template, $no_error = false) 169 { 158 function display($template, $no_error = false) { 170 159 if (!$no_error) { 171 160 global $GLOBAL_ERR; … … 186 175 187 176 // オブジェクト内の変数をすべて割り当てる。 188 function assignobj($obj) 189 { 177 function assignobj($obj) { 190 178 $data = get_object_vars($obj); 191 179 … … 196 184 197 185 // 連想配列内の変数をすべて割り当てる。 198 function assignarray($array) 199 { 186 function assignarray($array) { 200 187 foreach ($array as $key => $val) { 201 188 $this->_smarty->assign($key, $val); … … 208 195 * @param integer $device_type_id 端末種別ID 209 196 */ 210 function assignTemplatePath($device_type_id) 211 { 197 function assignTemplatePath($device_type_id) { 212 198 213 199 // テンプレート変数を割り当て … … 224 210 225 211 // デバッグ 226 function debug($var = true) 227 { 212 function debug($var = true) { 228 213 $this->_smarty->debugging = $var; 229 214 }
Note: See TracChangeset
for help on using the changeset viewer.