Ed. Added php pattern template method.