Added the posibility to extend templates from php

Now you can specify what template to extends from using the sintax
"extends:parent.tpl|children.tpl"