werkint/templating-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

Installs: 922

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 6

Forks: 0

Open Issues: 0

Type:symfony-bundle

v0.1.1 2016-01-11 11:30 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:48:24 UTC


README

Deprecated

use twig compile instead; and you can use bower

Composer

composer require 'werkint/templating-bundle:dev-master'

Kernel

AppKernel::registerBundles:

        ...
    new \Werkint\Bundle\TemplatingBundle\WerkintTemplatingBundle()
        ...

Routing

app/config/routing.yml:

    werkint_templating.:
      resource: "@WerkintTemplatingBundle/Resources/config/routing.yml"
      prefix: "/api"
      options:
        expose: true
$router->generate('ajax_templating', ['template' => '@YourBundle/Some/someTemplate.twig'])

OR

define([
    'some-module/views/view',
    'werkint-templating/template!@YourBundle/Some/someTemplate.twig'
], function (View, template) {
    'use strict';

    return View.extend({
        'template': template,
    });
});

JS

bower install template --save

or include web/bundles/werkinttemplating/js/*.js

Public templates

@YourBundle/Resources/config/templates.yml:

parameters:
  your_bundle.public_templates:
    - @@YourBundle/Some/someTemplate.twig
services:
  your_bundle.public_template_provider:
    class: Your\Bundle\SomeBundle\Service\TemplateProvider
    arguments:
      - % your_bundle.public_templates%
    tags:
      - {name: werkint_templating.public_template }

Or Werkint\Bundle\TemplatingBundle\Service\TemplateProviderInterface