lendable / twig-bundle
load twig templates from the database
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 19 830
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 22
Forks: 1
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.2
- ext-pdo: *
- doctrine/doctrine-bundle: ^1.3.0
- doctrine/migrations: *
- doctrine/orm: *
- sonata-project/admin-bundle: ^3.0
- symfony/framework-bundle: ^3.4.26|^4.3.8|^5.0
- symfony/symfony: ^3.4.35|^4.3|^5.0
- symfony/twig-bundle: ^3.4|^4.3|^5.0
- twig/twig: ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.14
- php-coveralls/php-coveralls: ^2.1
- phpstan/phpstan: ^0.11
- phpstan/phpstan-phpunit: ^0.11
- phpunit/phpunit: ^7.0|^8.0
- sensiolabs/security-checker: ^5.0
README
TwigBundle
Symfony bundle that allows Twig templates to be loaded from database store.
Install
composer require lendable/twig-bundle
Require the bundle in your AppKernel.php
<?php class YourAppKernel extends \Symfony\Component\HttpKernel\Kernel { public function registerBundles(): array { $bundles = [ // ... new Alpha\TwigBundle\AlphaTwigBundle(), ]; return $bundles; } // ... }
You can use the provided Template
entity or use your own. Overwrite the bundle entity with setting paramater values for your entity class alpha_twig.entity.template.class
and the directory containing its YAML mapping alpha_twig.entity.template.mapping_dir
.
// your-application/app/config/config.yml parameters: alpha_twig.entity.template.class: 'Alpha\TwigBundle\Entity\Template' alpha_twig.entity.template.mapping_dir: 'src/Resources/config/doctrine'