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