The template method design pattern allows us to structure an algorithm into steps we can override in sub classes. This video clip explains this pattern using a code sample in PHP.
The source code is available for free download in my PHP Design Patterns course at http://abelski.lifemichael.com.