<?php
/* Smarty version 3.1.29, created on 2016-05-29 14:45:00
  from "E:\phptools\phpstudy\WWW\lmcms\index.htm" */

if ($_smarty_tpl->smarty->ext->_validateCompiled->decodeProperties($_smarty_tpl, array (
  'has_nocache_code' => false,
  'version' => '3.1.29',
  'unifunc' => 'content_574a8fecbf3617_10170706',
  'file_dependency' => 
  array (
    '79006b7324647685d66e222fa33aefd203d9bec7' => 
    array (
      0 => 'E:\\phptools\\phpstudy\\WWW\\lmcms\\index.htm',
      1 => 1464504259,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:head.html' => 1,
  ),
),false)) {
function content_574a8fecbf3617_10170706 ($_smarty_tpl) {
if (!is_callable('smarty_modifier_truncate')) require_once 'E:\\phptools\\phpstudy\\WWW\\lmcms\\smarty\\plugins\\modifier.truncate.php';
if (!is_callable('smarty_modifier_capitalize')) require_once 'E:\\phptools\\phpstudy\\WWW\\lmcms\\smarty\\plugins\\modifier.capitalize.php';
if (!is_callable('smarty_modifier_date_format')) require_once 'E:\\phptools\\phpstudy\\WWW\\lmcms\\smarty\\plugins\\modifier.date_format.php';
if (!is_callable('smarty_modifier_replace')) require_once 'E:\\phptools\\phpstudy\\WWW\\lmcms\\smarty\\plugins\\modifier.replace.php';
if (!is_callable('smarty_mb_wordwrap')) require_once 'E:\\phptools\\phpstudy\\WWW\\lmcms\\smarty\\plugins\\shared.mb_wordwrap.php';
$_smarty_tpl->compiled->nocache_hash = '32652574a8fecb08fe0_94155443';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gbk">

<title><?php echo $_smarty_tpl->tpl_vars['title']->value;?>
</title>

</head>

<body>

<br />

姓名：<?php echo $_smarty_tpl->tpl_vars['array']->value['name'];?>
<br/>

时间是：<?php echo $_smarty_tpl->tpl_vars['array']->value['date'];?>
<br/>

下面遍历数组测试

<br/>



<?php
$__section_i_0_saved = isset($_smarty_tpl->tpl_vars['__smarty_section_i']) ? $_smarty_tpl->tpl_vars['__smarty_section_i'] : false;
$__section_i_0_loop = (is_array(@$_loop=$_smarty_tpl->tpl_vars['shuzu']->value) ? count($_loop) : max(0, (int) $_loop));
$__section_i_0_total = $__section_i_0_loop;
$_smarty_tpl->tpl_vars['__smarty_section_i'] = new Smarty_Variable(array());
if ($__section_i_0_total != 0) {
for ($__section_i_0_iteration = 1, $_smarty_tpl->tpl_vars['__smarty_section_i']->value['index'] = 0; $__section_i_0_iteration <= $__section_i_0_total; $__section_i_0_iteration++, $_smarty_tpl->tpl_vars['__smarty_section_i']->value['index']++){
?>

 循环的标题是：<?php echo smarty_modifier_truncate($_smarty_tpl->tpl_vars['shuzu']->value[(isset($_smarty_tpl->tpl_vars['__smarty_section_i']->value['index']) ? $_smarty_tpl->tpl_vars['__smarty_section_i']->value['index'] : null)]['title'],8);?>
  循环的内容是：<?php echo $_smarty_tpl->tpl_vars['shuzu']->value[(isset($_smarty_tpl->tpl_vars['__smarty_section_i']->value['index']) ? $_smarty_tpl->tpl_vars['__smarty_section_i']->value['index'] : null)]['content'];?>
<br/>

<?php
}
}
if ($__section_i_0_saved) {
$_smarty_tpl->tpl_vars['__smarty_section_i'] = $__section_i_0_saved;
}
?>

<br/>

<hr>

<center>变量操作符号的使用</center>

<br/>

原来的操作符号是：<?php echo $_smarty_tpl->tpl_vars['value']->value;?>
<br/>

下面让首字母大写<br/>



<?php echo smarty_modifier_capitalize($_smarty_tpl->tpl_vars['value']->value);?>
<br/>

下面进行在后面加上个字符串<br/>

<?php echo ($_smarty_tpl->tpl_vars['value']->value).("加上个字符串....");?>


<br/>

<?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['time']->value,"%Y-%m-%d");?>
<br/>



当变量不存在的时候显示一个值<br/>

<?php echo (($tmp = @$_smarty_tpl->tpl_vars['time1']->value)===null||$tmp==='' ? "暂时没有时间" : $tmp);?>


<br/>

下面进行转码，比如说一些htm标签之类的了<br/>

<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['biaoqian']->value, ENT_QUOTES, 'UTF-8', true);?>


<br/>

下面进行缩进<br/>

在前面加上10个空格<br/>

<?php echo preg_replace('!^!m',str_repeat(" ",10),$_smarty_tpl->tpl_vars['biaoqian']->value);?>


<br/>

屏蔽字符或者字符串<br/>

<?php echo smarty_modifier_replace($_smarty_tpl->tpl_vars['biaoqian']->value,"bai","***");?>
<br />

<?php echo preg_replace('!<[^>]*?>!', ' ', $_smarty_tpl->tpl_vars['biaoqian']->value);?>
<br/>

行宽约束<br/>

<?php echo smarty_mb_wordwrap($_smarty_tpl->tpl_vars['biaoqian']->value,5,"<br>",false);?>


<hr>

php内置函数的使用<br/>

下面演示foreach的使用<br/>



 <br/>

<table width="100" border="1">

<tr><td>编号  </td><td>姓名</td></tr>

<?php
$_from = $_smarty_tpl->tpl_vars['name']->value;
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$__foreach_value_0_saved_item = isset($_smarty_tpl->tpl_vars['value']) ? $_smarty_tpl->tpl_vars['value'] : false;
$__foreach_value_0_saved_key = isset($_smarty_tpl->tpl_vars['k']) ? $_smarty_tpl->tpl_vars['k'] : false;
$_smarty_tpl->tpl_vars['value'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['k'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['value']->_loop = false;
foreach ($_from as $_smarty_tpl->tpl_vars['k']->value => $_smarty_tpl->tpl_vars['value']->value) {
$_smarty_tpl->tpl_vars['value']->_loop = true;
$__foreach_value_0_saved_local_item = $_smarty_tpl->tpl_vars['value'];
?>

<tr><td><?php echo $_smarty_tpl->tpl_vars['k']->value;?>
</td><td><?php echo $_smarty_tpl->tpl_vars['value']->value;?>
</td></tr>

<?php
$_smarty_tpl->tpl_vars['value'] = $__foreach_value_0_saved_local_item;
}
if ($__foreach_value_0_saved_item) {
$_smarty_tpl->tpl_vars['value'] = $__foreach_value_0_saved_item;
}
if ($__foreach_value_0_saved_key) {
$_smarty_tpl->tpl_vars['k'] = $__foreach_value_0_saved_key;
}
?>

</table>

<br/>

<hr>

<br/>

下面测试包含文件的使用

<br/>

<?php $_smarty_tpl->smarty->ext->_subtemplate->render($_smarty_tpl, "file:head.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 9999, $_smarty_tpl->cache_lifetime, array('title'=>"这是首页面的标题"), 0, false);
?>


<hr>

条件语句的使用<br/>

<?php if ($_smarty_tpl->tpl_vars['i']->value < 10) {?>

输入的值小于10

    <?php } elseif ($_smarty_tpl->tpl_vars['i']->value == 10) {?>

     输入的===10

   

<?php } else { ?>

输入的值大于10

<?php }?>

<hr>

文本处理<br/>



<?php echo '<script'; ?>
 language="javascript">

function ss(){

alert("dd");

}

<?php echo '</script'; ?>
>



<input type="button" value="点击" onclick="ss()">

<hr>

去除空格<br/>

<table> <tr></tr> <tr></tr> <tr></tr> </table>

<hr>

<center><h1>smarty缓存的使用</h1></center>

<?php
$_from = $_smarty_tpl->tpl_vars['array']->value;
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$__foreach_a_1_saved_item = isset($_smarty_tpl->tpl_vars['a']) ? $_smarty_tpl->tpl_vars['a'] : false;
$__foreach_a_1_saved_key = isset($_smarty_tpl->tpl_vars['k']) ? $_smarty_tpl->tpl_vars['k'] : false;
$_smarty_tpl->tpl_vars['a'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['k'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['a']->_loop = false;
foreach ($_from as $_smarty_tpl->tpl_vars['k']->value => $_smarty_tpl->tpl_vars['a']->value) {
$_smarty_tpl->tpl_vars['a']->_loop = true;
$__foreach_a_1_saved_local_item = $_smarty_tpl->tpl_vars['a'];
?>

<?php echo $_smarty_tpl->tpl_vars['a']->value;
echo $_smarty_tpl->tpl_vars['k']->value;?>


<?php
$_smarty_tpl->tpl_vars['a'] = $__foreach_a_1_saved_local_item;
}
if ($__foreach_a_1_saved_item) {
$_smarty_tpl->tpl_vars['a'] = $__foreach_a_1_saved_item;
}
if ($__foreach_a_1_saved_key) {
$_smarty_tpl->tpl_vars['k'] = $__foreach_a_1_saved_key;
}
?>

<?php echo $_smarty_tpl->tpl_vars['id']->value;?>


</body>

</html><?php }
}
