[ Поиск ] - [ Пользователи ] - [ Календарь ]
Полная Версия: Шаблонизатор Smarty 3
mmsgold
Никак не могу понять в чем ошибка и что я делаю не так, обычные переменные smarty выводит, а вот обработать массив не хочет и выдает вот такую не понятную мне ошибку
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}

Быстрый ответ:

 Графические смайлики |  Показывать подпись
Здесь расположена полная версия этой страницы.
Invision Power Board © 2001-2024 Invision Power Services, Inc.