Miscellaneous
  Home arrow Miscellaneous arrow Page 5 - Smarty for Beginners
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Download TestComplete 
Forums Sitemap 
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MISCELLANEOUS

Smarty for Beginners
By: Hermawan Haryanto
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 112
    2003-12-28

    Table of Contents:
  • Smarty for Beginners
  • File Creation
  • The Basics
  • What about accessing a database?
  • Some fun stuff

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Smarty for Beginners - Some fun stuff


    (Page 5 of 5 )

    Open your index.html file again and let's add some fun stuff. We will use some Smarty predefined variables.

    Add this line:

    {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}

    Refresh your browser and you'll see today's date and time on the server. The formatting is done using strftime().

    Add this line:

    {$smarty.server.PHP_SELF}

    Refresh your browser and you'll see the filename you are accessing now. I guess the file would be "/smartyrules/index.php". Let me know if it's something else :).

    You can read all of this stuff in the Smarty manual. There are plenty of Smarty predefined variables you can adapt and use on your pages. That's all for now, I'll be back with another tutorial soon. All questions and suggestions are welcome.

    About the Author

    Hermawan Haryanto is a Senior Programmer of a Web Development Company in Las Vegas. Handling programming services world wide and writing articles and tutorials since 1996. Authoring dEkap.com with his wife. Visit his homepage and you can contact him through hermawan at codewalkers dot com.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · and comming from me, "the smary expert", that must be something...
       · Yes, It's very important tutorial added to so many important ones we always read on...
       · I've used Smarty for two years totally incorrectly and appreciate a beginner's...
       · how about a sequel?
       · I liked the article, It is very useful,Can u send further details of it.I have...
       · Call me dense........but I have tried to get Smarty installed on my Win2K box...
       · What was the error message or something for clue. We can't help you if there are no...
       · Sorry - my mistake. Here are the two messages.Parse error: parse error,...
       · I re-read the tutorial and I saw that on line 12 in libs.inc.php would be this...
       · That did the trick - thanks very much for your reply.I never tried switching the...
       · how to connect mysql tables through php codings?
       · Is there an extension to smarty that will create external stylesheets (*.css...
       · simple jadi cepet ngerti.trims..;)
       · Hi,Nice article like many others on codewalkers.com ! However I'm not really...
       · For those who are interested you can get the solution of the exercice at...
       · I have been asking this same question for some time.I have used PHPLib a pretty...
       · I do not have an html folder in my "smartyrules" folder. I don't see it in other...
       · HiProbems are1)lib.inc.php - define ("SMARTY_DIR",...
       · great tutorial dude....had 3 days to learn a new architecture and to develop...
       · Friend, Just give the relative path or full path to where the folder...
       · It is a simple and informative tutorial about smarty
       · Thank you Hermawan Haryanto for providing such an easy way to start smarty.A good...
       · Hi, I'm Karen from Venezuela, maybe you'll see that my english isn't so good, but I...
       · Im getting error when I try to display page. It doesn't tell us how to upload...
       · But what is smartyu?
       · Nice tutorial, keep it up. There is this other tutorial about smarty templating that...
     

    MISCELLANEOUS ARTICLES

    - Using PHP to Stream MP3 Files and Prevent Il...
    - 10 Must Have Firefox Improvements
    - All About OpenOffice 3.0
    - Shell Script Writing
    - Loops in the UNIX Shell
    - The Test in the UNIX Shell
    - Data Streams and the UNIX Shell
    - Control Mechanisms of the UNIX Shell
    - Variables Within the UNIX Shell
    - The Shell and UNIX
    - In Detail: UNIX File Systems
    - Rights Management in UNIX
    - UNIX File Systems
    - The Terminal in UNIX
    - Operating Systems and UNIX





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    Stay green...Green IT