Zgupiałem.
Z funkcji wychodzi tablica $results potem:
$response = "";
foreach ($results as $result)
{
$response = "$response \n $result";
}
{
$smarty->assign($response);
}
Dump'uje ją w smartach. Pokazuje mi jej treść.
Kod smarty:
{$response|var_dump}
{if $response}
{literal}
<script type="text/javascript"> var response='{$response}';
alert(response);
{/literal}
{/if}
I wywala mi błędy:
string(56) " W naszej bazie danych nie istanieje taki adres e-mail"
Notice: Undefined index: response in /opt/lampp/htdocs/dir/includes/core/smarty/templates_c/e143f2b3e1988a2ae7e64e04bfca62094eb29e2a.file.index.tpl.php on line 35
Notice: Trying to get property of non-object in /opt/lampp/htdocs/dir/includes/core/smarty/templates_c/e143f2b3e1988a2ae7e64e04bfca62094eb29e2a.file.index.tpl.php on line 35
NULL
Notice: Undefined index: response in /opt/lampp/htdocs/dir/includes/core/smarty/templates_c/e143f2b3e1988a2ae7e64e04bfca62094eb29e2a.file.index.tpl.php on line 37
Notice: Trying to get property of non-object in /opt/lampp/htdocs/dir/includes/core/smarty/templates_c/e143f2b3e1988a2ae7e64e04bfca62094eb29e2a.file.index.tpl.php on line 37