Sunday, September 25, 2011

Install Smarty and Configure it with Xampp or Wamp on Windows


Web template engine for PHP, Smarty is best. It is helpful for web project that are performs by different people (e.g. programmer and designer). Smarty separates PHP from HTML, application logic and content from its presentation. It helps to replace business logic or design logic without hampering each other.

Configuration:
1. Download the latest XAMPP version from http://www.apachefriends.org/
2. Install at C: directory. (C:\xampp)
3. Create a new folder in xampp folder and rename it to smarty. (C:\xampp\smarty)
4. Download the latest Smarty version from http://www.smarty.net/
5. Unzip the content of Smarty zip file to smarty folder. (C:\xampp\smarty)
6. Create two folders templates_c and cache inside it. (C:\xampp\smarty\templates_c and C:\xampp\smarty\cache)
7. Open php.ini file (C:\xampp\php\php.ini), search for Paths and Directories. At Windows part, replace the line
include_path = ".;C:\xampp\php\pear\"
with
include_path = ".;C:\xampp\php\pear\;C:\xampp\smarty\libs\"
or Simply add the following
include_path = ".;C:\xampp\smarty\libs\"
8. Create a new folder in htdocs folder and rename it to smarty. (C:\xampp\htdocs\smarty)
9. Create two folders configs and templates inside it. (C:\xampp\htdocs\smarty\configs and C:\xampp\htdocs\smarty\templates)
10. Smarty configuration is done. Create two scripts index.php and index.tpl to test Smarty template engine.
11. Place index.php inside C:\xampp\htdocs\smarty\ and index.tpl inside C:\xampp\htdocs\smarty\templates\
index.php
<?php
// load Smarty library
require('Smarty.class.php');
$smarty = new Smarty;
$smarty->template_dir = 'C:/xampp/htdocs/smarty/templates';
$smarty->config_dir = 'C:/xampp/htdocs/smarty/config';
$smarty->cache_dir = 'C:/xampp/smarty/cache';
$smarty->compile_dir = 'C:/xampp/smarty/templates_c';
$smarty->assign('name','uzzal !!');
$smarty->display('index.tpl');
?>
index.tpl
<html>
<body>
Hello, {$name}
<body>
<html>
12. Open the web browser and type in the URL http://localhost/smarty

71 comments:

  1. As a complete novice and learner and after going around in circles and getting nowhere this is the most comprehensive version of installing 'Smarty' that I have come across. Thank you very much.

    By the way is the line $smarty->assign required or can it be omitted.

    ReplyDelete
  2. vxcvxcxbcxcvxcv bxc

    ReplyDelete
  3. nice post on smarty config and installation..
    good work...
    it will definitely help beginners...

    ReplyDelete
  4. Best.
    Best.
    Best Smarty quickstart ever.
    Only took like. An hour failing at other installation guides. And this thing just.
    5 minutes.
    done

    ReplyDelete
  5. Best.
    Best.
    Best Smarty quickstart ever.
    Only took like. An hour failing at other installation guides. And this thing just.
    5 minutes.
    done

    ReplyDelete
  6. Best.
    Best.
    Best smarty quickstart ever.
    Took like. An hour failing at other installation guides. And this one just.
    5 minutes.
    done

    ReplyDelete
  7. I think that what yοu typеd maԁe a great
    deal of senѕe. But, consiԁer this, suppose уоu ωrote a catchiег post title?
    I ain't suggesting your information is not solid., but what if you added something that grabbed people's attеntion?
    Ι mean "Install Smarty and Configure it with Xampp or Wamp on Windows"
    is κindа boring. Үou cοuld glanсe аt
    Yаhoo's front page and watch how they create news headlines to grab people interested. You might try adding a video or a related picture or two to grab readers interested about everything've written.
    Just my opіnion, it could bring your рosts
    а little livеlieг.
    Here is my homepage ; ipad pris

    ReplyDelete
  8. Right herе is the rіght website fοr anybοdy
    whο reallу wants to find out about this tоpic.
    Yοu unԁerstand so much its almost hard to argue wіth you (not that I actually ωould wаnt tο…HaHa).
    Υou certainly put a fгesh ѕpin οn a
    topiс whіch has bеen wrіtten about for a lοng time.
    Great ѕtuff, just excellent!
    Visit my webpage : billige lån

    ReplyDelete
  9. Remarkable! Ӏts really awesome paragraph, I have got much clear idеa conсerning from this article.
    My weblog ipad pris

    ReplyDelete
  10. Thіѕ paragraph will help thе іntеrnet vieωers foг сreаting neω ωebsіte oг еven а blog
    from start to enԁ.
    Check out my website Låne Penge

    ReplyDelete
  11. Ahaa, its good discussion on the topic of this article here at this webpage, I
    have read all that, so at this time me also commenting at this place.
    Feel free to visit my web-site : budget laundry

    ReplyDelete
  12. Hi friends, its enormous paragraph on the topic
    of educationand fully defined, keep it up all the
    time.
    Here is my web page printable grocery coupons

    ReplyDelete
  13. you're actually a just right webmaster. The website loading speed is amazing. It sort of feels that you are doing any unique trick. Also, The contents are masterwork. you have performed a wonderful activity in this subject!
    Look at my blog : name brand detergent

    ReplyDelete
  14. When I initially left a comment I appear to have
    clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I get 4 emails with the same comment.

    Is there a means you are able to remove me from that service?
    Appreciate it!
    Also visit my page :: click the next site

    ReplyDelete
  15. Today, I went to the beach front with my children.
    I found a sea shell and gave it to my 4
    year old daughter and said "You can hear the ocean if you put this to your ear." She put the shell to
    her ear and screamed. There was a hermit crab inside and it pinched her ear.

    She never wants to go back! LoL I know this is entirely off topic but I had to tell someone!
    Also visit my blog : cheap cayman island vacations

    ReplyDelete
  16. Hmm is anyone else having problems with the images on this blog loading?
    I'm trying to find out if its a problem on my end or if it's
    the blog. Any suggestions would be greatly appreciated.
    Also visit my site : kredite für selbständige ohne sicherheiten

    ReplyDelete
  17. Do you mіnd if I quοtе a feω of
    your posts as long as I proνide credit and sourcеѕ back tо your webѕite?
    My websitе іs in the veгy same area
    of intеreѕt as youгѕ and mу visitors woulԁ certaіnly benefit
    fгοm ѕomе of the іnfοrmation уou present here.

    Plеasе let me knοw if thіs ok with you.
    Many thanks!
    Feel free to surf my webpage - ipad 2 pris

    ReplyDelete
  18. Thanks for another informative site. The place else may I am getting that
    kind of info written in such an ideal manner?
    I have a undertaking that I am simply now working on, and I have been
    at the glance out for such information.
    my webpage > mom work from home jobs

    ReplyDelete
  19. Thanks for the marvelous posting! I genuinely enjoyed reading it, you might be a great author.
    I will remember to bookmark your blog and will come back someday.
    I want to encourage you to ultimately continue your great work, have a nice morning!
    Also see my web page - great honeymoon destinations

    ReplyDelete
  20. Today, I went to the beachfront with my children. I found
    a sea shell and gave it to my 4 year old daughter and said "You can hear the ocean if you put this to your ear." She put the shell to her ear and screamed.
    There was a hermit crab inside and it pinched her ear.

    She never wants to go back! LoL I know this is entirely off topic
    but I had to tell someone!
    Also visit my site ; web hosting review

    ReplyDelete
  21. You can certainly see your expertise within the article you write.

    The arena hopes for more passionate writers such as you who are not
    afraid to say how they believe. At all times follow your heart.


    my web blog - http://lmsv2.lpru.ac.th/user/profile.php?id=35670
    My site :: https://www.virtualpre-k.org/es/node/19597

    ReplyDelete
  22. Ηi there to evеry ѕinglе one,
    it's truly a pleasant for me to pay a visit this site, it includes valuable Information.

    Look at my web page; http://Onlinecasino.cd/

    ReplyDelete
  23. I blog quite often and I really thank you for your content.
    The article has really peaked my interest.
    I'm going to take a note of your site and keep checking for new details about once per week. I subscribed to your Feed too.

    Review my blog: coupons online

    ReplyDelete
  24. Hi there just wanted to give you a quick heads up. The text in your post seem to be running off the screen in Safari.
    I'm not sure if this is a formatting issue or something to do with browser compatibility but I figured I'd post to let you know.
    The layout look great though! Hope you get
    the issue fixed soon. Thanks

    my homepage :: Joomla Seo Expert

    ReplyDelete
  25. This paragraph provides clear idea in support of the new people of blogging, that really how to do
    blogging.

    Look at my web page ... krankenversicherung vergleich beamte

    ReplyDelete
  26. Hey! Someone in my Facebook group shared this site with us so I came to take a look.

    I'm definitely enjoying the information. I'm book-marking
    and will be tweeting this to my followers! Superb blog and excellent design.


    Feel free to surf to my homepage geld ohne schufa auskunft

    ReplyDelete
  27. I loved as much as you'll receive carried out right here. The sketch is attractive, your authored material stylish. nonetheless, you command get got an nervousness over that you wish be delivering the following. unwell unquestionably come further formerly again as exactly the same nearly very often inside case you shield this increase.

    Also visit my web blog - sofortkredit für arbeitslose

    ReplyDelete
  28. Hi! This is my first comment here so I just wanted to give a quick shout
    out and say I really enjoy reading your posts. Can you suggest any other blogs/websites/forums that go over the same
    subjects? Thanks a lot!

    my site Read �

    ReplyDelete
  29. It's a shame you don't have a donate button!

    I'd without a doubt donate to this superb blog! I guess for now i'll settle for bookmarking and adding your RSS feed
    to my Google account. I look forward to fresh updates and will share this
    website with my Facebook group. Chat soon!

    Review my homepage ... unlimited alpha reseller hosting

    ReplyDelete
  30. Howdy! Someone in my Facebook group shared this
    website with us so I came to check it out. I'm definitely loving the information. I'm
    bookmarking and will be tweeting this to my followers!

    Fantastic blog and wonderful style and design.

    Stop by my web site free affiliate software
    Also see my site :: Adsene

    ReplyDelete
  31. Hi there to every body, it's my first pay a visit of this webpage; this blog contains amazing and in fact fine information in support of visitors.

    Also visit my webpage :: physician assistant

    ReplyDelete
  32. Very great post. I simply stumbled upon your weblog and wished to mention that I've really loved browsing your blog posts. After all I will be subscribing for your rss feed and I hope you write again soon!

    Feel free to visit my web blog; Cheap Website hosting

    ReplyDelete
  33. Very great post. I simply stumbled upon your weblog and wished to
    mention that I've really loved browsing your blog posts. After all I will be subscribing for your rss feed and I hope you write again soon!

    Look at my page :: Cheap Website hosting
    my page > vps ??????

    ReplyDelete
  34. What's up, after reading this awesome article i am too cheerful to share my familiarity here with colleagues.

    Feel free to visit my web site; beitragsbemessungsgrenze krankenversicherung 2011
    My page > gesetzliche krankenkasse beitragssatz

    ReplyDelete
  35. Aԁmiring the hаrԁ work you ρut
    іnto youг blog аnԁ dеtailed іnformatiοn
    уou offer. It's good to come across a blog every once in a while that isn't the
    ѕame outdated rehashed information. Fantastic
    read! I've saved your site and I'm including yоuг
    RSS feedѕ tο my Google account.



    Here is my blog; Online Casino
    my page :: Casino online reviews

    ReplyDelete
  36. Hey! Would you mind if I share your blog with my zynga group?
    There's a lot of people that I think would really appreciate your content. Please let me know. Cheers

    my weblog - madeline island vacations

    ReplyDelete
  37. I am sure this post has touched all the internet usеrs, іts really reаlly pleasant
    ροst οn building uρ new ωeb sitе.


    Feel free to visіt my homepage - Casino Online Reviews

    ReplyDelete
  38. We are a bunch of volunteers and opening a new scheme in our community.

    Your web site offered us with valuable information to work
    on. You've done a formidable process and our entire group will likely be grateful to you.

    my blog :: eilkredite ohne schufa

    ReplyDelete
  39. WOW just what I was searching for. Came here by searching for
    online entrepreneur ideas

    Look at my web page business ideas for small towns

    ReplyDelete
  40. Whats up are using Wordpress for your blog platform?
    I'm new to the blog world but I'm trying to get started and create my own.
    Do you require any coding expertise to make your own blog?

    Any help would be greatly appreciated!

    Also visit my site: seo my site

    ReplyDelete
  41. What's up i am kavin, its my first occasion to commenting anyplace, when i read this article i thought i could also make comment due to this brilliant post.

    my page :: private krankenzusatzversicherung vergleich

    ReplyDelete
  42. With havin so much written content do you
    ever run into any problems of plagorism or copyright infringement?
    My website has a lot of unique content I've either written myself or outsourced but it looks like a lot of it is popping it up all over the web without my permission. Do you know any methods to help reduce content from being ripped off? I'd
    genuinely appreciate it.

    Feel free to surf to my webpage ... internet money making

    ReplyDelete
  43. Greetings I am so thrilled I found your webpage,
    I really found you by error, while I was researching on Aol
    for something else, Regardless I am here now and would just like to say thank you for a remarkable
    post and a all round exciting blog (I also
    love the theme/design), I don’t have time to look over
    it all at the minute but I have saved it and also added your RSS feeds,
    so when I have time I will be back to read more, Please do keep up the excellent jo.


    Here is my web-site: usanetcasino.com

    ReplyDelete
  44. Hmm it looks like your website ate my first comment (it was super long) so I guess I'll just sum it up what I wrote and say, I'm thoroughly
    enjoying your blog. I as well am an aspiring blog blogger
    but I'm still new to the whole thing. Do you have any tips for novice blog writers? I'd genuinely
    appreciate it.

    Feel free to visit my site ... Highly recommended Online site

    ReplyDelete
  45. Sweet blog! I found it while browsing on Yahoo News. Do you have any
    suggestions on how to get listed in Yahoo News?
    I've been trying for a while but I never seem to get there! Many thanks

    Feel free to surf to my blog post; www.healthy-desserts.org
    Also see my web page - click the next website page

    ReplyDelete
  46. Aw, this was an extremely nice post. Taking a few minutes and actual effort to create a very good article… but what
    can I say… I procrastinate a lot and never manage to get nearly anything done.


    Here is my web-site :: Going On this site
    my page :: http://onlinecasinogamescasino.com

    ReplyDelete
  47. What you published was actually very logical.

    However, what about this? suppose you added a little information?
    I am not saying your information isn't solid., but what if you added a headline that makes people want more? I mean "Install Smarty and Configure it with Xampp or Wamp on Windows" is kinda vanilla. You could peek at Yahoo's front page and
    note how they create news titles to get viewers interested.
    You might try adding a video or a pic or two to get people interested about everything've got to say. In my opinion, it could bring your website a little bit more interesting.

    Feel free to visit my blog; http://howtoplaycasinogame.org

    ReplyDelete
  48. Hi, i think that i saw you visited my web site so i came to go back the prefer?
    .I'm attempting to to find things to enhance my web site!I suppose its adequate to use some of your ideas!!

    My page; search engine optimization site

    ReplyDelete
  49. I am genuinely thankful to the owner of this web page who has shared this great post at here.


    Have a look at my weblog :: Slot Machine USA

    ReplyDelete
  50. I do accept as true with all the concepts you've presented for your post. They're really convincing and
    will definitely work. Still, the posts are too short for starters.
    May just you please lengthen them a little from subsequent
    time? Thank you for the post.

    Feel free to surf to my weblog: Slots Jungle Casino

    ReplyDelete
  51. Hi, the whole thing is going fine here and ofcourse every one is sharing facts,
    that's truly good, keep up writing.

    Check out my blog :: student private loan consolidation

    ReplyDelete
  52. Hi there! Do you know if they make any plugins to
    protect against hackers? I'm kinda paranoid about losing everything I've
    worked hard on. Any recommendations?

    Here is my homepage krankenversicherung für selbstständige
    Also see my website: gute private krankenversicherung

    ReplyDelete
  53. Hey there would you mind stating which blog platform you're using? I'm
    planning to start my own blog in the near future but I'm having a tough time choosing between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your design seems different then most blogs and I'm looking for
    something unique. P.S My apologies for being
    off-topic but I had to ask!

    Feel free to visit my web blog: private krankenversicherung beamte

    ReplyDelete
  54. I seldom comment, however i did a few searching and wound up here "Install Smarty and Configure it with Xampp or Wamp on Windows".
    And I do have a few questions for you if you don't mind. Is it only me or does it look like some of the responses look like they are written by brain dead individuals? :-P And, if you are writing at other online social sites, I'd like to keep
    up with everything new you have to post. Could you list
    of every one of all your social sites like your Facebook page, twitter feed, or linkedin profile?


    Stop by my weblog free affiliate website

    ReplyDelete
  55. Appreciate this post. Let me try it out.

    my homepage - Guaranteed search engine optimization

    ReplyDelete
  56. Hi mates, good paragraph and pleasant urging
    commented at this place, I am really enjoying by these.

    my weblog :: casino i danmark

    ReplyDelete
  57. At this time it seems like Movable Type is the top blogging platform out there right
    now. (from what I've read) Is that what you are using on your blog?

    Stop by my homepage - Discover More

    ReplyDelete
  58. Hey I know this is off topic but I was wondering if you knew of any
    widgets I could add to my blog that automatically tweet my newest twitter updates.

    I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

    Here is my weblog ... effective search engine optimization

    ReplyDelete
  59. Heya i am for the first time here. I came across this board and I find It truly useful & it helped me out much.
    I hope to give something back and help others like you aided me.



    Have a look at my web-site all inclusive vacations from toronto

    ReplyDelete
  60. Nice blog here! Also your site loads up very fast!
    What host are you using? Can I get your affiliate link to
    your host? I wish my website loaded up as fast as yours lol

    Here is my web-site; search engine optimization uk

    ReplyDelete
  61. Great blog! Do you have any hints for aspiring writers?
    I'm planning to start my own blog soon but I'm a little lost on everything.
    Would you propose starting with a free platform like Wordpress
    or go for a paid option? There are so many choices out there
    that I'm totally confused .. Any tips? Thanks a lot!

    Feel free to surf to my page :: printable all coupon

    ReplyDelete
  62. Hiya very cool website!! Man .. Excellent .. Amazing .. I will bookmark your blog and take the feeds also?
    I am glad to search out a lot of useful information here
    within the put up, we'd like work out more strategies in this regard, thank you for sharing. . . . . .

    Also visit my web page; stay at home parent resume

    ReplyDelete
  63. What's up i am kavin, its my first occasion to commenting anywhere, when i read this piece of writing i thought i could also make comment due to this good article.

    Also visit my web blog; unsecured debt consolidation

    ReplyDelete
  64. Wonderful article! This is the type of information that are meant to
    be shared across the web. Shame on Google for no longer positioning
    this submit upper! Come on over and talk over with my site .
    Thanks =)

    My blog - lenders for bad credit

    ReplyDelete
  65. Hi there! This blog post couldn't be written any better! Looking at this post reminds me of my previous roommate! He always kept talking about this. I will send this information to him. Pretty sure he'll have a
    great read. Thank you for sharing!

    My blog; line of Credit home equity

    ReplyDelete
  66. hello there and thank you for your info – I have certainly picked up something new from right here.
    I did however expertise a few technical points using this site,
    since I experienced to reload the website many times
    previous to I could get it to load properly.
    I had been wondering if your web hosting is OK?
    Not that I'm complaining, but sluggish loading instances times will very frequently affect your placement in google and can damage your high-quality score if advertising and marketing with Adwords. Anyway I am adding this RSS to my email and could look out for much more of your respective intriguing content. Make sure you update this again very soon.

    Check out my blog post ... bad credit mortgage refinance lenders

    ReplyDelete

  67. Warning: require(Smarty.class.php) [function.require]: failed to open stream: No such file or directory in D:\xampp\htdocs\smarty\index.php on line 3

    Fatal error: require() [function.require]: Failed opening required 'Smarty.class.php' (include_path='.;D:\xampp\php\PEAR') in D:\xampp\htdocs\smarty\index.php on line 3

    ReplyDelete
  68. Hi would you mind letting me know which web host you're utilizing?
    I've loaded your blog in 3 completely different internet
    browsers and I must say this blog loads a lot faster then most.

    Can you suggest a good internet hosting provider at
    a fair price? Kudos, I appreciate it!

    ReplyDelete
  69. Hi thesre too all, the contents existing at this web page are genuinely
    awesome for people knowledge, well, keep up the good work
    fellows.

    ReplyDelete
  70. Simply want to say your article is as astounding.
    The clearness in your put up is simply nice and that i can think you are knowledgeable on this subject.

    Fine along with your permission allow me to take hold of your RSS
    feed to keep up to date with imminent post. Thank you 1,000,000 and please keep up the gratifying work.

    ReplyDelete