Open Source Resources for Web Application Developers

Shopify - Online Store Builder
Follow Us on Social Sites
Subscribe RSS Subscribe Newsletter Like us on Facebook Follow us on Twitter Follow us on Google+
  • Home
  • News
  • Plugins
  • Design
  • Others
  • Books
  • About
01 Apr

PHP Template Inheritance Makes Reusable HTML Layouts

  • Framework, MIT License
  • Leave a Comment

Template Inheritance is an extremely useful technique for making reusable HTML layouts for a site. It is much more flexible than alternative techniques, such as “including” common elements of a page (like a header and footer file).

The concept has been around for a while, most notably in the Django template engine. Unlike other libraries, PHP Template Inheritance lets you write everything in straight PHP. There is no need to learn another template language.

It involves two separate templates, each in their own file: the parent template and the child template. The parent contains the HTML skeleton and markers for where content should go. These markers are calledblocks. The child then “fills-in” the blocks with content.

php-template

Requirements: PHP Framework
Demo: http://phpti.com/
License: MIT License

Share
Tweet
Sponsors
subscribe to our newsletter - weekly free resouces for web developers
follow us on social sites - rss, facebook, google+, Twitter
Subscribe RSS Like us on Facebook Follow us on Twitter Follow us on Google+
Related Resources
Bits & Pixels: Cross-Browser Transparent Columns

Bits & Pixels: Cross-Browser Transparent Columns

100+ Free HTML Email Templates with PSD Source Files

100+ Free HTML Email Templates with PSD Source Files

Interface Sketch Templates For Web, Mobile & Tablet

Interface Sketch Templates For Web, Mobile & Tablet

The Processing Language

The Processing Language

25 Slick PSD Website Templates Free for Download

25 Slick PSD Website Templates Free for Download

Google Ajax Language API for Detection and Translation

Google Ajax Language API for Detection and Translation

Comments
  • http://annanta.com Kevin S

    that is the reason i love web designing. We can do many more with html, css and php :) thanks for the awesome post :)

  • http://github.com/grimen grimen

    Heard of #content_for in Rails? ;D

  • http://n/a Nick

    Finally PHP re-invented the wheel or something all other use for ages – like masterpages ASP.NET. Good job guys!

    Now if you separate code from html/design to end this “spaghetti” madness… and eventually get rid of the $ in front of every variable it would be awesome. Unless you really want to see more dollars in your code.

  • Carlos

    @nick

    Lol, more dollars… PHP rules the web developer world!

  • http://www.karbon12.com Serge

    Nick: Smarty has separated code from design for a long time. Not only that, but Smarty has inheritance built into version 3.0.

  • http://wesam.ly Wesam Alalem

    thank you, another great stuff ;)
    I was thinking about using Smarty, but in my project is not that big. this is really handy.

  • Mike

    Yes, Smarty does separate code from design, but you do need to learn the template language. It is “too big” for a simple task. Nothing short of awesome, but way too bloated for small timers. I’m giving PHPTI a go.

Open Source Resources for You

What we need is a list of the top quality resources, so that we can spend more time on our web development. WebAppers only picks the top quality web development resources for you.

© Copyright 2012 WebAppers | About | Archives | Privacy Policy | Advertise | Contact

Sponsors
Advertise Here
Search
By Keywords
30 Days / All Time
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • Professional Business Cards Made By Designers
  • Best Free Chrome Extensions for Web Developers
  • All of the Best Free WordPress Themes You Need
  • How to Create a Web App Admin User Interface
  • Nice List of Open Source Fish Eye Menu
  • Best Web Admin Templates
  • 25 Useful Blogs for Web Design & Development
  • Simple Javascript Progress Bar with CSS
  • 10 Useful & Quality Design Resources
  • Free Web Application Icons
  • Free Responsive HTML5 + CSS3 Site Templates
  • 35 Creative Twitter Covers for Web Designers
  • FROONT: Responsive Web Design in the Visual Way
  • Designing Experiences for Responsive Web Sites
  • jQuery Unveil: The Lightweight Version of Lazy Load
  • What are HTML5 Datalists and When to Use Them
  • Easy Responsive Tabs jQuery Plugin for Web & Mobile
  • jQuery.Swatches Turns Div into a Sweet Color Swatch
  • Pure: A Set of Small & Responsive CSS Modules
  • Create Sexy Android-like UI with Fries
Sponsors
Plugins
  • Advertisement15
  • Calendar48
  • Capture19
  • Charts55
  • Chat22
  • Demo Tour17
  • Gallery121
  • Maps30
  • Menu87
  • Polls9
  • Popup50
  • Tooltips42
  • Upload33
  • Video18
Desgin
  • Brushes11
  • Buttons27
  • Color Schemes25
  • Fonts47
  • Forms115
  • Icons110
  • Patterns24
  • PS Tutorials17
  • Stock Photos21
  • Tables25
Others
  • Announcement104
  • Best Collections6
  • Code57
  • eCommerce25
  • Framework217
  • Hosting13
  • Information245
  • Inspiration32
  • Legal Documents10
  • Reviews8
  • Security13
  • Social28
  • Sound16
  • Stats40
  • Tools302
  • Webmail14
Licesnes
  • BSD License69
  • CC License123
  • GPL License224
  • LGPL License40
  • License Free749
  • MIT License423
Sponsors
Advertise Here
Partners
MaxCDN