Cotton Rohrscheib

The Cotton Club Blog & Podcast

  • Home
  • About
  • Blog
    • Collecting
    • Faith & Family
    • Marketing & Tech
    • Farm & Business
    • Entertainment
    • Health & Wellness
    • Urban Farming
    • Weekend Projects
  • Podcast
  • Newsletter
  • Media
    • Photo Galleries
    • Video Archives
    • Apple Music Playlists
  • Marketplace
  • Connect
You are here: Home / Marketing & Tech / PHPR / Smarty templates

PHPR / Smarty templates

April 8, 2008 by Cotton Rohrscheib Leave a Comment

Smarty Templates have been around for a while now and are pretty popular with developers.  One of the things that I really like about PHPR (PHPRUNNER) is that it utilizes Smarty Templates and stores them in a directory called <templates> inside of whatever application you are working in.  Let’s say we are working on a list page, with Smarty in use there are actually two separate files in play, one file will be called list.php and it will look something like this:

   1: include('Smarty.class.php');
   2:  
   3: // create object
   4: $smarty = new Smarty;
   5:  
   6: // assign some content. This would typically come from
   7: // a database or other source, but we'll use static
   8: // values for the purpose of this example.
   9: $smarty->assign('name', 'george smith');
  10: $smarty->assign('address', '45th & Harris');
  11:  
  12: // display it
  13: $smarty->display('list.htm');

As you can see, the list.php page just contains your actual PHP Code itself.  The second file in this equation is located inside of the <templates> directory and is called list.htm.  It contains the html and css values for the page:

   1: <html>
   2: <head>
   3: <title>User Info</title>
   4: </head>
   5: <body>
   6:  
   7: User Information:<p>
   8:  
   9: Name: {$name}<br>
  10: Address: {$address}<br>
  11:  
  12: </body>
  13: </html>

PHPRunner manual – Smarty templates

Share this post on:

  • Share on Facebook (Opens in new window) Facebook
  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Email a link to a friend (Opens in new window) Email
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Pinterest (Opens in new window) Pinterest

Filed Under: Marketing & Tech Tagged With: PHP Smarty, PHPRunner IDE, WYSIWYG

About Cotton Rohrscheib

The Cotton Club is a monthly podcast hosted by me, Cotton Rohrscheib. I'm a 52 year old entrepreneur w/ ADHD, OCD (and now AARP) that refuses to grow up as I grow old. I have collaborated and invested in hundreds of projects throughout my career in multiple industries such as; technology, healthcare, and agriculture. I also have 25 years experience in the marketing industry as a co-founder of an award-winning advertising agency. I will undoubtedly cover a wide variety of topics on my podcast while sharing some really crazy stories and situations that I've been fortunate to witness firsthand. I also have a book coming out in 2025 titled, "Mistakes were Made"

Leave a Reply Cancel reply

You must be logged in to post a comment.

Recent Updates

  • Thank You FBN…
  • Flashback to Farmers & Furries…
  • Ep035: Cotton Rohrscheib & Mark James Discuss Old School Memphis Wrestling
  • Collecting Classic Southern Rock Vinyl Albums
  • Upcoming Podcast w/ World-Renowned Author & Memphis Wrestling Historian Mark James

Blog Categories

  • Blog (452)
  • Collecting (9)
  • Entertainment (381)
  • Faith & Family (156)
  • Farm & Business (307)
  • Health & Wellness (38)
  • Marketing & Tech (595)
  • Podcasts (34)
  • Urban Farming (25)
  • Weekend Projects (16)

Blog Archives

Content Copyright © 2000-2026
Cotton Rohrscheib | Rohrscheib Capital
Disclaimer | Privacy Policy | Account Manager | View Cart

All opinions expressed on this website are 100% Cotton (see my disclaimer). All content, including text, images, and media, are the intellectual property of Rohrscheib Capital unless otherwise noted. To learn how we use your private information, checkout our privacy policy.