Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
5 / 5 |
CRAP | |
100.00% |
18 / 18 |
Template | |
100.00% |
1 / 1 |
|
100.00% |
5 / 5 |
5 | |
100.00% |
18 / 18 |
__construct | |
100.00% |
1 / 1 |
1 | |
100.00% |
8 / 8 |
|||
render | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
get | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
builder | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
buildBuilder | |
100.00% |
1 / 1 |
1 | |
100.00% |
7 / 7 |
<?php | |
namespace PHPixie; | |
class Template | |
{ | |
protected $builder; | |
public function __construct( | |
$slice, | |
$filesystemLocator, | |
$configData, | |
$filesystemRoot = null, | |
$externalExtensions = array(), | |
$externalFormats = array() | |
) | |
{ | |
$this->builder = $this->buildBuilder( | |
$slice, | |
$filesystemLocator, | |
$configData, | |
$filesystemRoot, | |
$externalExtensions, | |
$externalFormats | |
); | |
} | |
public function render($name, $data = array()) | |
{ | |
return $this->builder->renderer()->render($name, $data); | |
} | |
public function get($name, $data = array()) | |
{ | |
return $this->builder->container($name, $data); | |
} | |
public function builder() | |
{ | |
return $this->builder; | |
} | |
protected function buildBuilder( | |
$slice, | |
$filesystemLocator, | |
$configData, | |
$filesystemRoot, | |
$externalExtensions, | |
$externalFormats | |
) | |
{ | |
return new Template\Builder( | |
$slice, | |
$filesystemLocator, | |
$configData, | |
$filesystemRoot, | |
$externalExtensions, | |
$externalFormats | |
); | |
} | |
} |