lendable/twig-bundle

load twig templates from the database

Installs: 15 977

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 15

Forks: 1

Open Issues: 0

Type:symfony-bundle

v2.0.1 2019-12-30 19:24 UTC

This package is auto-updated.

Last update: 2021-03-01 00:07:00 UTC


README

Scrutinizer Code Quality Build Status Coverage Status Latest Stable Version Total Downloads

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'

License

MIT