407 posts
  • Has been part of the Envato Community for over 5 years
  • Located in Australia
envato says
960 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+4 more
jeffeatworld says

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

6 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $100+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
+2 more
QueerDesigns 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 part of the Envato Community for over 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
  • Has been part of the Envato Community for over 5 years
  • Has collected 1+ items on Envato Market
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
  • Has been part of the Envato Community for over 3 years
  • Located in Greece
kostaskerkira says

fantastic tutorial continue the good job :)

4601 posts Community Mod Building awesome stuff for your mobile devices!
  • Contributed a blog post
  • Elite Author: Sold more than $75,000 on Envato Market
  • Helps us moderate the forums
  • Has sold $125,000+ on Envato Market
+15 more
Enabled Moderator says

Very old thread. Locking it up.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by