|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
toto Smarty Rookie
Joined: 28 Aug 2004 Posts: 14 Location: Russia, Tomsk
|
Posted: Thu Oct 07, 2004 9:56 pm Post subject: tpl2php пере
 |
|
|
как можно устоновить переменую в tpl
и получить её в php скрипте
например количество постов на страницу
get_template_vars берёт её как я понимаю
а как задать ?? |
|
Back to top |
|
toto Smarty Rookie
Joined: 28 Aug 2004 Posts: 14 Location: Russia, Tomsk
|
Posted: Thu Oct 07, 2004 10:04 pm Post subject: |
|
|
Решение:
assign используется для установки значения переменной в процессе выполнения шаблона.
{assign var="name" value="Bob"}
Вывод: Нужно больше спать, и сказать чтобы мануаль сдалали удобочитаемую ))
например напротив каждый функцию краткое её значение)) |
|
Back to top |
|
toto Smarty Rookie
Joined: 28 Aug 2004 Posts: 14 Location: Russia, Tomsk
|
Posted: Thu Oct 07, 2004 10:13 pm Post subject: |
|
|
как вот тока её в пхп обратно засунуть что то я не донал (( |
|
Back to top |
|
b166-er Smarty Rookie
Joined: 22 Oct 2004 Posts: 29 Location: Germany, Wiesbaden
|
Posted: Fri Oct 22, 2004 10:08 pm Post subject: |
|
|
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
poka
________
Buy vapir vaporizer |
|
Back to top |
|
|
|
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
|