Puppy Service
, (*1)
Basic services for Puppy framework., (*2)
Installation
$ composer require raphhh/puppy-service
Session
Service for Symfony\Component\HttpFoundation\Session\Session., (*3)
Template
Service for Twig_Environment., (*4)
Note that the services are accessible in twig templates with the global variable "services"., (*5)
Twig has also a filter "link". This filter prepends the config "baseUrl" to a link., (*6)
<a href="{{ 'my/page'|link }}">click here</a>
Config options
- 'template.directory.main' => path to the directory of the template files.
- 'template.directory.cache' => path to the directory of the cache of the template files.
- 'template.debug' => indicates if the debug mode is enable in the template.
- 'baseUrl' => gives the base url to apply for the twig filter "link".
- 'session.sessionStorageClass' => name of the class to handle the session storage.
- 'session.attributeBagClass' => name of the class to handle the attributes session.
- 'session.flashBagClass' => name of the class to handle the flash session.