symfony-util/controller-using-templating-http-foundation

Controller which renders a template and returns a response (HttpFoundation)

dev-master / 7.0.x-dev 2019-02-27 23:56 UTC

This package is auto-updated.

Last update: 2024-04-29 03:44:29 UTC


README

Controller which renders a template and returns a response (HttpFoundation)

PHPPackages Rank Monthly Downloads PHPPackages Referenced By Tested PHP Versions Dependency Status Build Status Code Coverage Scrutinizer SensioLabsInsight

TODO

  • Test more than one Symfony version!

EngineAsArgumentController

Composer configuration for use in Symfony Framework or elsewhere where this controller is called by the Symfony kernel

  • as long as there is the tiniest risk that Symfony < 3.3 could be installed by composer
  • ie Symfony 2.8 is supported until close to the end of 2018 it will survive up to mid 2019 and more in distributions like Debian
  • https://symfony.com/roadmap
$ composer req symfony-util/controller-using-templating-http-foundation-http-kernel

otherwise just

$ composer req symfony-util/controller-using-templating-http-foundation

Symfony configuration (kernel with MicroKernelTrait from symfony/framework)

symfony/routing
function configureRoutes(RouteCollectionBuilder $routes)
{
    // ...
    $routes->add('/', SymfonyUtil\Controller\EngineAsArgumentController::class, 'index');
    // ...
}
symfony/dependency-injection
protected function configureContainer(ContainerBuilder $c, LoaderInterface $loader)
{
    // ...
    $c->autowire(SymfonyUtil\Controller\EngineAsArgumentController::class)
        ->setAutoconfigured(true)
        ->addTag('controller.service_arguments')
        ->setPublic(false);
    // ...

Icon: https://material.io/icons/#ic_wallpaper

TODO

PHP 7

string arguments
Why code in scripts directory in 5.3 and 5.4 branches is not included in ^7?

Versions

PHP

5.5 TemplatingController::class in unit tests
5.6 __invoke(...$arguments) in VariadicController.php
7.0 (master)
  • declare(strict_types=1);
  • function f(): float
  • function s(string $s)