General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old January 28th, 2003, 04:05 PM
arnorg arnorg is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 13 arnorg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
changing from Xtemplate to Smarty template engine

The xtemplate engine project is dead so i have to move my design layout engine in my CMS to something that has better support....

How about smarty

Can i switch to smarty with my multi template html sites

in Xtemplate i have it something like this:
This is one file.......one file with many different blocks..


PHP Code:
<!-- BEGINmain -->

<
html>
<
head>
<
title>awesome template!</title>
</
head>
<
body>

<!-- 
BEGINevents -->
{
event_text}
<!-- 
ENDevents -->

<!-- 
BEGINnews -->
{
news_text}
<!-- 
ENDnews -->

<!-- 
BEGINnews_archive -->
{
news_text2}
<!-- 
ENDnews_archive -->


</
body>
</
html>
<!-- 
ENDmain -->



and 
the index.php would be:


$kaktus is an variable in the xtpl class and is:
var 
$kaktus=()array;

if(
in_array('events',$kaktus))
{
$xtpl->assign(event_text,$event);
$xtpl->parse("main.events");
}

if(
in_array('news',$kaktus))
{
$xtpl->assign(news_text,$news_text);
$xtpl->parse("main.news");
}

if(
in_array('news_archive ',$kaktus))
{
$xtpl->assign(news_text2,$text);
$xtpl->parse("main.news_archive");
}

$xtpl->parse("main");
$xtpl->out("main"); 


Basically if i need to add a module like a question poll, a news feed or some kind of list....everything that i have to pull out from database and loop the records from it......no need for do some php work.....i only have to add a block (<!-- BEGIN: news --> and <!-- END: news --> and then it itīs parsed and printed out...


so a designer that doesnīt know anything in php, can build a dynamic site i have donīt have to do anything in php for him...

Does smarty have something similar things? and how is that done?

Reply With Quote
  #2  
Old February 1st, 2003, 02:19 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
arnorg,

I'm not too familiar with Smarty, but I use patTemplate myself. Based on the code you posted, it seems very similar to patTemplate...

Lindset has also written an article on getting started with patTemplate that will ease your transition.

Hope that sheds some light.
__________________
____________________________________________
Developer Shed Weekly Writer | DevArticles Forum Moderator
Build Your Own KlipFolio Klip With PHP
FrankManno.com - Under Construction
Design Interactive Group - Under Construction

Reply With Quote
  #3  
Old February 1st, 2003, 03:27 PM
arnorg arnorg is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 13 arnorg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Well...

Iīm not asking about switching to PatTemplate...i asking how i can switch the same blocks system in this template engines (pat and Xtemplate) to smarty..

Because Smarty is just the fastest...

Reply With Quote
  #4  
Old February 2nd, 2003, 11:29 AM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
arnorg,

Well, some will argue that it's not... but that's another discussion. I pointed you to patTemplate as I thought the learning curve would be a lot quicker coming from Xtemplate...

As far as learning Smarty, have you checked out the Smarty site for resources?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > changing from Xtemplate to Smarty template engine


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway