Added getTemplateDirectories method to ParserInterface

This commit is contained in:
Franck Allimant
2014-07-03 16:25:50 +02:00
parent b4f3e3b60a
commit c0541e3aa2
3 changed files with 16 additions and 5 deletions

View File

@@ -52,6 +52,7 @@
<argument type="service" id="request"/> <argument type="service" id="request"/>
<argument type="service" id="thelia.parser.context"/> <argument type="service" id="thelia.parser.context"/>
<argument type="service" id="thelia.parser"/>
<call method="setFormDefinition"> <call method="setFormDefinition">
<argument>%thelia.parser.forms%</argument> <argument>%thelia.parser.forms%</argument>

View File

@@ -35,22 +35,32 @@ interface ParserInterface
*/ */
public function setTemplateDefinition(TemplateDefinition $templateDefinition); public function setTemplateDefinition(TemplateDefinition $templateDefinition);
/**
* Get template definition
*
* @param bool $webAssetTemplate Allow to load asset from another template
* If the name of the template if provided
*
* @return TemplateDefinition
*/
public function getTemplateDefinition($webAssetTemplate = false);
/** /**
* Add a template directory to the current template list * Add a template directory to the current template list
* *
* @param unknown $templateType the template type ( * @param int $templateType the template type (
* *
* @param string $templateName the template name * @param string $templateName the template name
* @param string $templateDirectory path to the template dirtectory * @param string $templateDirectory path to the template dirtectory
* @param unknown $key ??? * @param string $key ???
* @param string $unshift ??? Etienne ? * @param bool $unshift ??? Etienne ?
*/ */
public function addTemplateDirectory($templateType, $templateName, $templateDirectory, $key, $unshift = false); public function addTemplateDirectory($templateType, $templateName, $templateDirectory, $key, $unshift = false);
/** /**
* Return the registeted template directories for a givent template type * Return the registeted template directories for a givent template type
* *
* @param unknown $templateType * @param int $templateType
* @throws \InvalidArgumentException if the templateType is not defined * @throws \InvalidArgumentException if the templateType is not defined
* @return array: an array of defined templates directories for the given template type * @return array: an array of defined templates directories for the given template type
*/ */

View File

@@ -211,7 +211,7 @@ class SmartyParser extends Smarty implements ParserInterface
* @param int $templateType the template type (a TemplateDefinition type constant) * @param int $templateType the template type (a TemplateDefinition type constant)
* @param string $templateName the template name * @param string $templateName the template name
* @param string $templateDirectory path to the template dirtectory * @param string $templateDirectory path to the template dirtectory
* @param unknown $key ??? * @param string $key ???
* @param boolean $unshift ??? Etienne ? * @param boolean $unshift ??? Etienne ?
*/ */
public function addTemplateDirectory($templateType, $templateName, $templateDirectory, $key, $unshift = false) public function addTemplateDirectory($templateType, $templateName, $templateDirectory, $key, $unshift = false)