Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Problem z assign

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Polish
View previous topic :: View next topic  
Author Message
chomiczek
Smarty n00b


Joined: 12 Nov 2010
Posts: 1

PostPosted: Fri Nov 12, 2010 12:02 pm    Post subject: Problem z assign Reply with quote

mam w pliku tpl taki kod (wycięte zbędne rzeczy)
Code:
{foreach from=$products item=product name=products}
[cut]
{assign var=plik value=`$product,reference`}
{include_php file='sprawdzZdalnyPlik.php'}
 {if $pisz == 'ok'}
{$product.reference|escape}
{else}
pisz: 404
[cut]
{/if}
{/foreach}


plik PHP
[php]
if (remote_file_exists('http://url/zdjecia/foto/'.$this->get_template_vars("plik").'.jpg')==200) $pi = 'ok';
else $pi = 'er';
$this->assign('pisz', $pi);
[/php]
i zwraca prawidłowo pisz, ale tylko za pierwszym razem, później wywala błąd?
z tego co widzę to {assign var=plik value=`$product,reference`} za drugim razem tworzy tablice.. czy można jakoś usunąć zmienną? w tym przypadku plik

udało mi się skorzystać z tego http://smarty.incutio.com/?page=unassign i po ponowny przetworzeniu pętli foreach zmienna jest pusta i nie mogę jej ponownie przypisać.. dlaczego?
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Polish All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP