SlaxWeb Framework
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SlaxWeb\ViewTwig\Loader\Twig Class Reference
Inheritance diagram for SlaxWeb\ViewTwig\Loader\Twig:
Inheritance graph
[legend]
Collaboration diagram for SlaxWeb\ViewTwig\Loader\Twig:
Collaboration graph
[legend]

Public Member Functions

 __construct (Response $response, Logger $logger, Twig_Environment $twig)
 
- Public Member Functions inherited from SlaxWeb\View\AbstractLoader
 __construct (Response $response, Logger $logger)
 
 setTemplateExt (string $tplExt)
 
 setTemplate (string $template)
 
 setTemplateDir (string $templateDir)
 
 render (array $data=[], int $return=self::TPL_OUTPUT, int $cacheData=self::TPL_CACHE_VARS)
 

Protected Member Functions

 load (string $template, array $data)
 
- Protected Member Functions inherited from SlaxWeb\View\AbstractLoader
 combineData (array $data, int $cacheData)
 
 load (string $template, array $data)
 

Protected Attributes

 $_fileExt = "html"
 
 $twig = null
 
- Protected Attributes inherited from SlaxWeb\View\AbstractLoader
 $response = null
 
 $logger = null
 
 $tplExt = ""
 
 $template = ""
 
 $templateDir = ""
 
 $cachedData = []
 

Additional Inherited Members

- Public Attributes inherited from SlaxWeb\View\AbstractLoader
const TPL_CACHE_VARS = 100
 
const TPL_USE_VARS_ONLY = 101
 
const TPL_NO_CACHE_VARS = 102
 
const TPL_RETURN = 200
 
const TPL_OUTPUT = 201
 

Constructor & Destructor Documentation

SlaxWeb\ViewTwig\Loader\Twig::__construct ( Response  $response,
Logger  $logger,
Twig_Environment  $twig 
)

Class constructor

Assigns the dependant Response object to the class property. The View loader will automatically add template contents to as response body.

Parameters
\Symfony\Component\HttpFoundation\Response$responseResponse object
\Psr\Log\LoggerInterface$loggerPSR4 compatible Logger object
\Twig_Environment$twigTwig template loader
Returns
void

Member Function Documentation

SlaxWeb\ViewTwig\Loader\Twig::load ( string  $template,
array  $data 
)
protected

Load template

Load and render the template file with twig.

Parameters
string$templatePath to the template file
array$dataView data
Returns
string

The documentation for this class was generated from the following file: