模板引擎修正

This commit is contained in:
thinkphp
2016-09-30 21:38:54 +08:00
parent 9d99b7d55c
commit 77928649d7
2 changed files with 4 additions and 4 deletions

View File

@@ -977,14 +977,14 @@ class Template
break;
case 'COOKIE':
if (isset($vars[2])) {
$parseStr = '\\think\\Cookie::get(\'' . $vars[1] . '.' . $vars[2] . '\']';
$parseStr = '\\think\\Cookie::get(\'' . $vars[1] . '.' . $vars[2] . '\')';
} else {
$parseStr = '\\think\\Cookie::get(\'' . $vars[1] . '\')';
}
break;
case 'SESSION':
if (isset($vars[2])) {
$parseStr = '\\think\\Session::get(\'' . $vars[1] . '.' . $vars[2] . '\']';
$parseStr = '\\think\\Session::get(\'' . $vars[1] . '.' . $vars[2] . '\')';
} else {
$parseStr = '\\think\\Session::get(\'' . $vars[1] . '\')';
}

View File

@@ -295,9 +295,9 @@ EOF;
<?php echo \$_GET['action']; ?><br/>
<?php echo \$_POST['action']; ?><br/>
<?php echo \\think\\Cookie::get('action'); ?><br/>
<?php echo \$_COOKIE['action']['name']; ?><br/>
<?php echo \\think\\Cookie::get('action.name'); ?><br/>
<?php echo \\think\\Session::get('action'); ?><br/>
<?php echo \$_SESSION['action']['name']; ?><br/>
<?php echo \\think\\Session::get('action.name'); ?><br/>
<?php echo \$_ENV['OS']; ?><br/>
<?php echo \$_REQUEST['action']; ?><br/>
<?php echo SITE_NAME; ?><br/>