class Blitz_somehash {
/*
при парсинге шаблона сюда помещаем массив вида Путь->функция
array(
'A'=>'getBlockA'
'A/B'=>'getBlockAB'
)
на самом деле getBlockA и getBlockAB могут быть вообще любыми случайными символами, тут показал чисто для наглядности
*/
protected $block = array();
protected function getBlockA($markers=array()) {
return $this->getMarkerValue('hello', $markers).'Я люблю '.$this->getBlockAB($markers['A']);
}
protected function getBlockAB($markers=array()) {
return 'PHP!';
}
public function fetch($path='/', $markers=array()) {
$function_name = $this->block[$path];
return $this->$function_name($markers);
}
}