![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 40 Pomógł: 0 Dołączył: 29.08.2002 Ostrzeżenie: (0%) ![]() ![]() |
Witam,
Mam taki problem pisze obecnie projekt w którym chce wykorzystać templaty cos takiego jak w phpBB2. Tylko nie wiem jak sie zabrac do tego aby skrypt po przeanalizowaniu zawartosci pliku template znalazl wszystkie wyrazenia bedace w formie np. {TYTUL} i zamienil je na odpowiednie elementy tablicy w tym wypadku chcialbym aby zamienialo to na $element['TYTUL']. Bardzo prosze o pomoc i z góry dziękuje. pozdrawiam jarek |
|
|
![]()
Post
#2
|
|
![]() Grupa: Zarejestrowani Postów: 33 Pomógł: 0 Dołączył: 30.08.2002 Ostrzeżenie: (0%) ![]() ![]() |
z manuala php
[ciach] str_replace (mixed search, mixed replace, mixed subject) This function returns a string or an array with all occurences of search in subject replaced with the given replace value. If you don't need fancy replacing rules, you should always use this function instead of ereg_replace() or preg_replace(). In php 4.0.5 and later, every parameter to str_replace() can be an array. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well. If search and replace are arrays, then str_replace() takes a value from each array and uses them to do search and replace on subject. If replace has fewer values than search, then an empty string is used for the rest of replacement values. If search is an array and replace is a string; then this replacement string is used for every value of search. The converse would not make sense, though. Przykład 1. str_replace() example $bodytag = str_replace("%body%", "black", "<body text=%body%>"); [/ciach] -------------------- --
[Linux Administrator] |
|
|
![]()
Post
#3
|
|
![]() Grupa: Zarejestrowani Postów: 207 Pomógł: 0 Dołączył: 7.03.2002 Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
Zamiast sikać pod wiatr proponowałbym zainteresowanie się:
Smarty - http://smarty.php.net/ FastTemplates - idunno -------------------- Tomasz Wasiluk
Polcode >> Szukamy programistów z pasją |
|
|
![]()
Post
#4
|
|
![]() Grupa: Zarejestrowani Postów: 50 Pomógł: 0 Dołączył: -- Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
Cytat Zamiast sikać pod wiatr proponowałbym zainteresowanie się:
Smarty - http://smarty.php.net/ FastTemplates - idunno Smarty to jeden z najbardziej rozbudowanych systemow templeatowych. W dodatku na standardowej instalacji php ( bez akceleratorow) jest bardzo wolny. Dlatego tez na prywatny uzytek polecam jednak Fast Templates -------------------- Pozdrawiam,
Piotr Drewnik || haiaw@crew.php.pl |
|
|
![]()
Post
#5
|
|
Grupa: Zarejestrowani Postów: 40 Pomógł: 0 Dołączył: 29.08.2002 Ostrzeżenie: (0%) ![]() ![]() |
a gdzie moge zdobyc fast template?
|
|
|
![]()
Post
#6
|
|
Grupa: Zarejestrowani Postów: 40 Pomógł: 0 Dołączył: 29.08.2002 Ostrzeżenie: (0%) ![]() ![]() |
ok mam juz dzieki http://phpclasses.mysiar.net/browse.html/p...package/23.html
|
|
|
![]()
Post
#7
|
|
![]() Grupa: Zarejestrowani Postów: 207 Pomógł: 0 Dołączył: 7.03.2002 Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
Cytat Smarty to jeden z najbardziej rozbudowanych systemow templeatowych.
W dodatku na standardowej instalacji php ( bez akceleratorow) jest bardzo wolny. Dlatego tez na prywatny uzytek polecam jednak Fast Templates Jesli zastosowac cachowanie strony to wcale nie wychodzi tak zle. -------------------- Tomasz Wasiluk
Polcode >> Szukamy programistów z pasją |
|
|
![]()
Post
#8
|
|
![]() Grupa: Zarejestrowani Postów: 50 Pomógł: 0 Dołączył: -- Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
Cytat Cytat Smarty to jeden z najbardziej rozbudowanych systemow templeatowych.
W dodatku na standardowej instalacji php ( bez akceleratorow) jest bardzo wolny. Dlatego tez na prywatny uzytek polecam jednak Fast Templates Jesli zastosowac cachowanie strony to wcale nie wychodzi tak zle. Ale cachowanie to nie zawsze dobry pomysl. 8) http://www.phpinsider.com/php/code/Smarty/benchmarks/ -------------------- Pozdrawiam,
Piotr Drewnik || haiaw@crew.php.pl |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 8.07.2025 - 08:38 |