Catchable fatal error: Argument 2 passed to Smarty_Internal_Compile_Private_ForeachSection::scanForProperties() must be an instance of Smarty_Internal_TemplateCompiler, instance of Smarty_Internal_SmartyTemplateCompiler given, called in C:\OpenServer\domains\myshop.local\library\Smarty\libs\sysplugins\smarty_internal_compile_foreach.php on line 133 and defined in C:\OpenServer\domains\myshop.local\library\Smarty\libs\sysplugins\smarty_internal_compile_private_foreachsection.php on line 105
пример кода
function indexAction($smarty) {
$rsCategories = getAllMainCatsWithChildren();
d($rsCategories,0);
$smarty->assign('pageTitle','Главная страница сайта');
$smarty->assign('rsCategories', $rsCategories);
$arr = array('red', 'green', 'blue');
$smarty->assign('myColors', $arr);
$smarty->assign('test','Тестовая запись');
loadTemplate($smarty,'header');
loadTemplate($smarty,'index');
loadTemplate($smarty,'footer');
}
вывод в tpl
{foreach $myColors as $color}
<li>{$color}</li>
{/foreach}