configurator = $configurator;
$this->parameters = new TemplateParameterCollection;
}
/**
* Get all the parameters defined and/or used in all the templates
*
* @return array Associative array of parameters names and their default value
*/
public function getAllParameters()
{
// Collect parameters used in template
$params = [];
foreach ($this->configurator->tags as $tag)
{
if (isset($tag->template))
{
foreach ($tag->template->getParameters() as $paramName)
{
$params[$paramName] = '';
}
}
}
// Merge defined parameters and those collected from templates. Defined parameters take
// precedence
$params = iterator_to_array($this->parameters) + $params;
// Sort parameters by name for consistency
ksort($params);
return $params;
}
/**
* Return the renderer generator used by this instance
*
* @return RendererGenerator
*/
public function getEngine()
{
if (!isset($this->engine))
{
$this->setEngine('XSLT');
}
return $this->engine;
}
/**
* Return an instance of Renderer based on the current config
*
* @return Renderer
*/
public function getRenderer()
{
return $this->getEngine()->getRenderer($this);
}
/**
* Get the templates defined in all the targs
*
* @return array Associative array of template names and content
*/
public function getTemplates()
{
$templates = [
'br' => '
',
'e' => '',
'i' => '',
'p' => '