2017 © Pedro Peláez
 

library rad-view-renderer

image

knplabs/rad-view-renderer

  • Thursday, September 21, 2017
  • by Knplabs
  • Repository
  • 24 Watchers
  • 2 Stars
  • 20,279 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 10 Versions
  • 4 % Grown

The README.md

DEPRECATED

Unfortunately we decided to not maintain this project anymore (see why). If you want to mark another package as a replacement for this one please send an email to hello@knplabs.com., (*1)

Rad view renderer

Allow to guess a view when the controller does not return a Response., (*2)

Build Status Scrutinizer Code Quality Latest Stable Version Total Downloads Latest Unstable Version License, (*3)

Installation

Install the library:, (*4)

$ composer require knplabs/rad-view-renderer

If you are using Symfony, add the bundle inside your AppKernel.php:, (*5)

$bundles = array(
    // ...
    new Knp\Rad\ViewRenderer\Bundle\ViewRendererBundle(),
);

Usage

Let's take the following controller:, (*6)

namespace App\Controller;

class TestController
{
    public function someAction()
    {
        return ['foo' => 'bar'];
    }
}

By default the rad view renderer will take a look of the request content type in order to guess wich kind of render it will use. It exists many kind of renderer that can display many content types., (*7)

You can disable some native renderers using the renderers parameter in your config.yml:, (*8)

knp_rad_view_renderer:
    renderers: [controller, twig]

The twig renderer

One of the most useful renderer, it takes the controller class in order to guess the template to display. For example:, (*9)

App\Controller\TestController::someAction => @App/Resources/views/Test/some.%format%.twig

The Versions

14/01 2015

dev-fix/controller-fallback

dev-fix/controller-fallback

  Sources   Download

MIT

The Requires

 

The Development Requires