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

Odczytanie tablicy POST

 
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
Demerzel
Smarty Rookie


Joined: 31 Jan 2010
Posts: 26

PostPosted: Sun Jan 31, 2010 6:27 pm    Post subject: Odczytanie tablicy POST Reply with quote

Mam następująca sytuację:
1. W jednym pliku za pomocą smartów zapisuje dane do tablicy POST
Code:
<TD>   
      od: <input type="text" name="{$a.id}[f311]" value="{if $a.datefrom}{$a.datefrom|date_format:"%Y/%m/%d"}{else}-{/if}" style="width:70px;"> <br>
      do: <input type="text" name="{$a.id}[f312]" value="{if $a.dateto}{$a.dateto|date_format:"%Y/%m/%d"}{else}-{/if}" style="width:70px;">
   </TD>

Powyższy zapis sprawóje sie dobrze pod warunkiem, iz na sztywno zapisuje co chce odczytać:
Code:
<TD>od: {$post.2.f311}<BR>
       do: {$post.2.f312}</TD>

Problem stanowi zastąpienie sztywnego ustawienia cyfry 2 przez zmienną $a.id. Zapis $post.$a.id.f312 jak myśle oddaje cel jest jednak nieskuteczny. JAk w prawidłowy sposób w smartach odczytać taką tablicę?
Back to top
View user's profile Send private message
bordeux
Smarty Rookie


Joined: 27 Jul 2010
Posts: 10

PostPosted: Wed May 30, 2012 11:00 am    Post subject: Reply with quote

Nie wiem jakim ci cudem działa
Code:

{$post.NAZWA}

Aby dostać się do tablicy $_POST, używa się
Code:

{$smarty.post.NAZWA}


Ale nie o to ci chodzi.
O to rozwiązanie
Code:

{$smarty.post[$a.id].f312}
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