Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Smarty CSS zmienna :)
seba199696
post
Post #1





Grupa: Zarejestrowani
Postów: 119
Pomógł: 0
Dołączył: 4.01.2011

Ostrzeżenie: (20%)
X----


Witam (IMG:style_emoticons/default/smile.gif) Mam pytanie, jeżeli w pliku .php
  1. $smarty->assign('img', 'name.png');

a w pliku .tpl
  1. #site { background:#ffffff url('templates/images/{$img}') no-repeat bottom right;}

można w ten sposób wstawiać zmienną do css? Zmniejszy to wydajność strony?

Ten post edytował seba199696 29.03.2012, 13:59:55
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
gothye
post
Post #2





Grupa: Zarejestrowani
Postów: 702
Pomógł: 65
Dołączył: 16.03.2009

Ostrzeżenie: (0%)
-----


nie tak :

  1. #site { background:#ffffff url('templates/images/{$img}') no-repeat bottom right;}


a tak :

  1. #site{literal} { background:#ffffff url('templates/images/{/literal}{$img}{literal}') no-repeat bottom right;}{/literal}


inaczej smarty wywali błąd składni
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 14.10.2025 - 22:42