W3cubDocs

/Symfony 4.1

ControllerNameParser deprecated

class ControllerNameParser

deprecated

since Symfony 4.1

ControllerNameParser converts controller from the short notation a:b:c (BlogBundle:Post:index) to a fully-qualified class::method string (Bundle\BlogBundle\Controller\PostController::indexAction).

Properties

protected $kernel

Methods

__construct(KernelInterface $kernel)
string parse(string $controller)

Converts a short notation a:b:c to a class::method.

string build(string $controller)

Converts a class::method notation to a short one (a:b:c).

Details

__construct(KernelInterface $kernel)

Parameters

KernelInterface $kernel

string parse(string $controller)

Converts a short notation a:b:c to a class::method.

Parameters

string $controller A short notation controller (a:b:c)

Return Value

string A string in the class::method notation

Exceptions

InvalidArgumentException when the specified bundle is not enabled or the controller cannot be found

string build(string $controller)

Converts a class::method notation to a short one (a:b:c).

Parameters

string $controller A string in the class::method notation

Return Value

string A short notation controller (a:b:c)

Exceptions

InvalidArgumentException when the controller is not valid or cannot be found in any bundle

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Bundle/FrameworkBundle/Controller/ControllerNameParser.html