407 posts
  • Australia
  • Has been a member for 5-6 years
envato says
960 posts
  • Bought between 10 and 49 items
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
  • United Kingdom
jeffeatworld says

Nice tut – graphics do a sweet job tooo well done.

DevelopmentOcean Recent Posts Threads Started
6 posts
  • Beta Tester
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 100 and 1 000 dollars
  • United States
DevelopmentOcean says

Nice tut! but personally I would do:

public function __construct( $name ) { $this->path = sprintf( '%s/%s.php', self::DIRECTORY, $name ); }

so that I can call the template class like:

$template = new Template( 'page' );

Just my preference.

~Adam Smith

2 posts
  • Has been a member for 5-6 years
JGarrido says

Good concept, and it seems like a good tutorial, although I haven’t tried implementing it yet.

I did notice this typo:
a bit hard to understand what’s going on here. B

At the end of this tutorial I want to list some

ut if you follow the order of method calls carefully you’ll get it.

BTW , any chance you can provide the files in a zip file for quick review?

1 post
  • Bought between 1 and 9 items
  • Has been a member for 4-5 years
smurkas says

Umm you can actually already do what you propose in Smarty. Smarty doesn’t force you to include three separate files as header-content-footer, you can do the master template with one or more content areas instead if you want.

To use master template pattern you simply write {include file=”$tplName.tpl”} or whatever you want to call your file variable in the place that you want it included. Just set this variable to the content template you want to load and you’re done. In fact this is the basic example in Smartys tutorials which is where I got it from.

I think the header-content-footer pattern simply has been the most popular pattern for some time until people realised how much this sucked on sites with alot of markup.

1 post
  • Greece
  • Has been a member for 3-4 years
kostaskerkira says

fantastic tutorial continue the good job :)

4153 posts Community Mod Building awesome stuff for your mobile devices!
  • Community Moderator
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Interviewed on the Envato Notes blog
  • Author had a Free File of the Month
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Contributed a Tutorial to a Tuts+ Site
  • Won a Competition
+9 more
Enabled Volunteer moderator says

Very old thread. Locking it up.