Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
Использование тега {php} по умолчанию отключено и считается устаревшим.
— Автоматическое игнорирование фигурных скобок "{", "}", если они окружены пробелами (больше не требуется окружать Javascript {literal}{/literal} или использовать другой маркер тега).
<?php /* Smarty version 2.6.26, created on 2010-11-16 14:48:36
compiled from index2.tpl */ ?>
<?php if (!function_exists('smarty_fun_foo')) { function smarty_fun_foo(&$smarty, $params) { $_fun_tpl_vars = $smarty->_tpl_vars; $smarty->assign($params); ?>
<?php if (! is_null ( $smarty->_tpl_vars['exec'] )): ?>
<?php $_from = $smarty->_tpl_vars['data']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
foreach ($_from as $smarty->_tpl_vars['d']):
?>
<div><?php echo $smarty->_tpl_vars['d']; ?>
</div>
<?php endforeach; endif; unset($_from); ?>
<?php endif; ?>
<?php $smarty->_tpl_vars = $_fun_tpl_vars; }} smarty_fun_foo($this, array('exec'=>null)); ?>
<?php smarty_fun_foo($this, array('data'=>$this->_tpl_vars['data'],'exec'=>1)); ?>
<?php /* Smarty version Smarty-3.0.4, created on 2010-11-16 14:49:08
compiled from "./templates/index3.tpl" */ ?>
<?php /*%%SmartyHeaderCode:1315927594ce27dc484bdd9-24256128%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'bdf3642ce8219fafc40cbd62ea1ae69117a48c72' =>
array (
0 => './templates/index3.tpl',
1 => 1289907677,
2 => 'file',
),
),
'nocache_hash' => '1315927594ce27dc484bdd9-24256128',
'function' =>
array (
'foo' =>
array (
'parameter' =>
array (
'nocache' => false,
),
'compiled' => '
<?php $_smarty_tpl->tpl_vars[\'d\'] = new Smarty_Variable;
$_from = $_smarty_tpl->getVariable(\'data\')->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, \'array\');}
if ($_smarty_tpl->_count($_from) > 0){
foreach ($_from as $_smarty_tpl->tpl_vars[\'d\']->key => $_smarty_tpl->tpl_vars[\'d\']->value){
?>
<div><?php echo (isset($_smarty_tpl->tpl_vars[\'d\']->value)? $_smarty_tpl->tpl_vars[\'d\']->value: null);?>
</div>
<?php }} ?>',
'nocache_hash' => '1315927594ce27dc484bdd9-24256128',
'has_nocache_code' => false,
),
),
'has_nocache_code' => 0,
)); /*/%%SmartyHeaderCode%%*/?>
<?php Smarty_Internal_Function_Call_Handler::call ('foo',$_smarty_tpl,array('data'=>$_smarty_tpl->getVariable('data')->value),'1315927594ce27dc484bdd9_24256128',false);?>
Вышел Smarty 3 Final. Что нового?