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

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

This package is auto-updated.

Last update: 2022-01-22 16:24:01 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