vvsh Posted January 15, 2009 Report Share Posted January 15, 2009 Добрый день.Скажите пожалуйста, какой шаблонизатор является самым лучшим и в то же время простым? Quote Link to comment Share on other sites More sharing options...
0 Иван Шумов Posted January 15, 2009 Report Share Posted January 15, 2009 свой, самописный Quote Link to comment Share on other sites More sharing options...
0 rash Posted January 15, 2009 Report Share Posted January 15, 2009 Тот, который наиболее полно отвечает вашим требованиям.«Не создавай — улучшай». Велосипедов хватает. Quote Link to comment Share on other sites More sharing options...
0 vvsh Posted January 15, 2009 Author Report Share Posted January 15, 2009 Я бы с удовольствием свой написал, но я на это потрачу очень много времени. Quote Link to comment Share on other sites More sharing options...
0 Иван Шумов Posted January 15, 2009 Report Share Posted January 15, 2009 15 минут самый простой30 минут - с небольшими наворотами40 минут - ООП шаблонизатор Quote Link to comment Share on other sites More sharing options...
0 vvsh Posted January 15, 2009 Author Report Share Posted January 15, 2009 (edited) Кто-нибудь видел шаблоны на Юкозе как устроены? Мне так надо.15 минут самый простой30 минут - с небольшими наворотами40 минут - ООП шаблонизаторМожешь поподробней описать какой простой, какой с наворотами? Edited January 15, 2009 by vvsh Quote Link to comment Share on other sites More sharing options...
0 Victor Ananiev Posted January 15, 2009 Report Share Posted January 15, 2009 если ты еще не заметил, юкозом тут пользуется меньшенство.. по этому на твой вопрос мало кто ответит, так как не знают что там вообще на юкозе) Quote Link to comment Share on other sites More sharing options...
0 vvsh Posted January 15, 2009 Author Report Share Posted January 15, 2009 (edited) там шаблоны вида:<html><head><title>$SITE_NAME$ - $PAGE_NAME$</title>$STYLES$</head><body>$BODY$</body></html> Edited January 15, 2009 by vvsh Quote Link to comment Share on other sites More sharing options...
0 Ялекс Posted January 15, 2009 Report Share Posted January 15, 2009 (edited) Обычный$out = str_replace('$' . $VAR_NAME . '$', $varibles[$VAR_NAME], $out);Смарти хороший и мощный шаблонизатор. Простой в использовании. Edited January 15, 2009 by Ялекс Quote Link to comment Share on other sites More sharing options...
0 vvsh Posted January 15, 2009 Author Report Share Posted January 15, 2009 Если бы смарти мне нравился я бы его использовал.А можешь привести примерную структуру такого простого шаблонизатора? Quote Link to comment Share on other sites More sharing options...
0 homm Posted January 15, 2009 Report Share Posted January 15, 2009 $line = preg_replace_callback( '/$[a-zA-Z_-]+$/', create_function( '$matches', 'return $GLOBAL[\'$matches\'];' ), $line}; Quote Link to comment Share on other sites More sharing options...
0 vvsh Posted January 15, 2009 Author Report Share Posted January 15, 2009 спасибо. Quote Link to comment Share on other sites More sharing options...
0 vvsh Posted January 15, 2009 Author Report Share Posted January 15, 2009 ОбычныйКод$out = str_replace('$' . $VAR_NAME . '$', $varibles[$VAR_NAME], $out);Там еще есть проверка условий вида: <?if($i$=1)?><?else?><?endif?> Quote Link to comment Share on other sites More sharing options...
0 Ялекс Posted January 15, 2009 Report Share Posted January 15, 2009 homm, THUMBS_UPvvsh,<? if($i == 1): ?>True<? else: ?>False<? endif; ?>Это PHP конструкция и к шаблонизатору не относится. Quote Link to comment Share on other sites More sharing options...
0 Victor Ananiev Posted January 15, 2009 Report Share Posted January 15, 2009 хм, а зачем нужен шаблонизатор? обьявление переменных вида $var$ это все? Quote Link to comment Share on other sites More sharing options...
0 Ялекс Posted January 15, 2009 Report Share Posted January 15, 2009 Вот на хабре по поводу Смарти развели кучу комментов, есть очень ценные мысли насчет шаблонизаторов.http://rmcreative.ru/blog/post/smarty-3-alphaНе поленись - почитай. Quote Link to comment Share on other sites More sharing options...
0 Emm Posted January 16, 2009 Report Share Posted January 16, 2009 XTemplate Quote Link to comment Share on other sites More sharing options...
0 Vlad Posted January 16, 2009 Report Share Posted January 16, 2009 Из всех просмотренных мной шаблонизатором, Smarty показался самым удобным.Еще Dwoo рекомендовали, который лишен недостатков Smarty.http://forum.htmlbook.ru/index.php?showtopic=10056 Quote Link to comment Share on other sites More sharing options...
0 s0rr0w Posted January 16, 2009 Report Share Posted January 16, 2009 Из всех просмотренных мной шаблонизатором, Smarty показался самым удобным.Особенно, если самому дописывать функции, модификаторы, блочные функции.В последнее время мы вообще "обнаглели", и начали XML из базы гнать почти напрямую в смарти. Ускорение разработки получилось порядка 5 раз. Quote Link to comment Share on other sites More sharing options...
0 Ялекс Posted January 16, 2009 Report Share Posted January 16, 2009 Это в смысле XML в смарти напрямую из базы?То биш$xml_object = simplexml_load_file('base.xml');$smarty_object->assign('xml_object', $xml_object)? Quote Link to comment Share on other sites More sharing options...
0 vvsh Posted January 16, 2009 Author Report Share Posted January 16, 2009 У юкоза можно использовать конструкции <?if($g==1)?>, а пхп запрещен. Quote Link to comment Share on other sites More sharing options...
0 Ялекс Posted January 16, 2009 Report Share Posted January 16, 2009 Не запрещено ничего.Правильно пишется:<? if( $test == '1' ): ?> One thing <? else: ?> Second thing <? endif; ?>А если в шаблонизаторе используется PHP-конструкции и "специальные" $VAR$ то я не знаю что это за уродец. Quote Link to comment Share on other sites More sharing options...
0 vvsh Posted January 16, 2009 Author Report Share Posted January 16, 2009 Там не пхп, а так <?if($g==1)?>да<?else?>нет<?endif?>, а пхп незя. Quote Link to comment Share on other sites More sharing options...
0 Ялекс Posted January 16, 2009 Report Share Posted January 16, 2009 Это ту-по. Применять шаблонизатор просто ради "убийста" двоеточия в родной ПХП-шой конструкции. Quote Link to comment Share on other sites More sharing options...
0 vvsh Posted January 16, 2009 Author Report Share Posted January 16, 2009 Это для облегчения.Так как раньше было как в пхп. Quote Link to comment Share on other sites More sharing options...
0 s0rr0w Posted January 16, 2009 Report Share Posted January 16, 2009 То бишИменно. Quote Link to comment Share on other sites More sharing options...
Question
vvsh
Добрый день.
Скажите пожалуйста, какой шаблонизатор является самым лучшим и в то же время простым?
Link to comment
Share on other sites
26 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.