Miscellaneous

  Home arrow Miscellaneous arrow Page 5 - Smarty for Beginners
MISCELLANEOUS

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

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

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    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.
    blog comments powered by Disqus

    MISCELLANEOUS ARTICLES

    - Oracle Database XE: Indexes and Sequences
    - Modifying Tables in Oracle Database XE
    - Oracle Database XE: Tables and Constraints
    - More on Oracle Databases and Datatypes
    - Oracle Database XE Datatypes: Datetime and L...
    - Oracle Database XE Datatypes: Character and ...
    - From Databases to Datatypes
    - Firefox 3.6.6 Released with Improved Plug-in...
    - Attention Bloggers: WordPress 3.0 Now Releas...
    - Reflection in PHP 5
    - Inheritance and Other Advanced OOP Features
    - Advanced OOP Features
    - Linux from Scratch V.6.6 Review
    - Linux Gaining in Strength
    - Install Slackware on Your Old PC


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 11 - Follow our Sitemap