Смарти. Не пойму что за ошибка

P8
На сайте с 19.01.2008
Offline
10
439


function get_country_start(&$smarty)
{
$sql="select * from rus_regions where parent_country=0 order by rating desc, id asc limit 0,15";
$res=db_select($sql);
$txt = '<option value="0">– Выберите страну –</option>';
while ($item = mysql_fetch_array($res))
{
$txt .= '<option value="'.$item['id'].'">'.$item['country'].'</option>';
}
return $txt;
}
$smarty->register_function("get_country_start", "get_country_start");

Потом в шаблоне вызываю эту функцию


<select id="country" name="country" onChange="handleListChange(this.id);">
{get_country_start}
</select>

и получаю ошибку:

Fatal error: Only variables can be passed by reference in D:\htdocs\site\templates_c\%%38^38E^38EBB4D2%%reg_form.tpl.php on line 102

Почему?

Shtogrin
На сайте с 02.11.2006
Offline
95
#1

function get_country_start() 

Аргумент вы все равно не используете и не передаете

www.shtogrin.com (http://www.shtogrin.com/). Канцтовары (http://www.invit.com.ua/). 1С Бухгалтерия (http://account.kiev.ua/).
P8
На сайте с 19.01.2008
Offline
10
#2

Так как правильно сделать?

Shtogrin
На сайте с 02.11.2006
Offline
95
#3

Замените строку

function get_country_start(&$smarty)

на

function get_country_start()

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий