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

tpl2php пере&#10

 
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: Russian
View previous topic :: View next topic  
Author Message
toto
Smarty Rookie


Joined: 28 Aug 2004
Posts: 14
Location: Russia, Tomsk

PostPosted: Thu Oct 07, 2004 9:56 pm    Post subject: tpl2php пере&#10 Reply with quote

как можно устоновить переменую в tpl
и получить её в php скрипте
например количество постов на страницу

get_template_vars берёт её как я понимаю
а как задать ??
Back to top
View user's profile Send private message Visit poster's website
toto
Smarty Rookie


Joined: 28 Aug 2004
Posts: 14
Location: Russia, Tomsk

PostPosted: Thu Oct 07, 2004 10:04 pm    Post subject: Reply with quote

Решение:
assign используется для установки значения переменной в процессе выполнения шаблона.
{assign var="name" value="Bob"}

Вывод: Нужно больше спать, и сказать чтобы мануаль сдалали удобочитаемую ))
например напротив каждый функцию краткое её значение))
Back to top
View user's profile Send private message Visit poster's website
toto
Smarty Rookie


Joined: 28 Aug 2004
Posts: 14
Location: Russia, Tomsk

PostPosted: Thu Oct 07, 2004 10:13 pm    Post subject: Reply with quote

как вот тока её в пхп обратно засунуть что то я не донал ((
Back to top
View user's profile Send private message Visit poster's website
b166-er
Smarty Rookie


Joined: 22 Oct 2004
Posts: 29
Location: Germany, Wiesbaden

PostPosted: Fri Oct 22, 2004 10:08 pm    Post subject: Reply with quote

wsju informatzju is shablon (html) moshna dostawat po obitchnomu sposobu: ili tcherez: $_GET ili $_POST.

esli ti postawil naprimer $username w smarty : ...assign('user',$username);

togda sdelaj ili link <a href...?user={$username}...
ili formular. s newidoj knopkaj:
<input type="hidden" name="user" value="{$username}">

i wsjo!!!
teper pri kashdoj perezagruski twojej stranizi budut otsilatsa eti variabli kak POST ili GET. i ti ih smoshesh w php scripte potom pojmat, tcherez:
$_GET['user'] ili $_POST['user']

zagljadiwaj wdrugije forumi, tam eto toshe stoit, dashe esli i ne na russkom, no source-code on, i w afrike source-code Smile

poka
________
Buy vapir vaporizer
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: Russian 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