Developed with love by KnpLabs Hire us for your project!
0

LiipXsltBundle

by liip

[DEPRECATED] Renderer for XSLT templates in Symfony2 (not actively maintained)

UNMAINTAINED

This bundle is no longer maintained. Feel free to fork it if needed.

XsltBundle

Renderer for XSLT templates in Symfony2.

Installation

  1. Add the following lines in your deps file:

    [LiipXsltBundle]
        git=http://github.com/liip/LiipXsltBundle.git
        target=/bundles/Liip/XsltBundle
    
  2. Run the vendors script:

    $ php bin/vendors install
    
  3. Add the Liip namespace to your autoloader:

    // app/autoload.php
    $loader->registerNamespaces(array(
        'Liip' => __DIR__.'/../vendor/bundles',
        // your other namespaces
    ));
    
  4. Add the bundle to your application kernel:

    // app/AppKernel.php
    public function registerBundles()
    {
        return array(
            // ...
            new Liip\XsltBundle\LiipXsltBundle(),
            // ...
        );
    }
    
  5. Enable the XSLT template engine in the config

    # app/config/config.yml
    # ...
    templating:      { engines: ['twig', 'xslt'] }
    # ...
    

Usage

Create an XSLT file in your views folder. Then in your controller simply call,
where the name of the Bundle is HelloBundle and the name of the controller
is HelloController:

return $this->render('HelloBundle:Hello:index.html.xsl', array('name' => $name));

Extensions

Extension can be used to add global data to the XML or to register PHP function callbacks.

This bundle already includes different extensions. To use them, use this in your application config:

# app/config/config.yml
liip_xslt:
     extensions: [liip_xslt.extension.environment, liip_xslt.extension.routes, liip_xslt.extension.debug]
Copyright (c) 2010-2011 Liip

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.