K
K
Kirill Nesmeyanov2016-08-04 19:39:38
symfony
Kirill Nesmeyanov, 2016-08-04 19:39:38

How to interrupt the execution of a controller method in Symfony?

Good day.
The task is to interrupt the default call of the controller method in order to get the class / action - call it yourself.
Kernel events kernel.controller with $event->stopPropagation() naturally don't work (sf 2.8), any ideas?
PS I'm trying to make a normal double-dispatch of methods.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kirill Nesmeyanov, 2016-08-04
@SerafimArts

FIG knows how to mark the issue as resolved here, but he did it through proxying the controller.

S
shagguboy, 2016-08-05
@shagguboy

public function indexAction($name)
{
    $response = $this->forward('AcmeHelloBundle:Hello:fancy', array(
        'name'  => $name,
        'color' => 'green',
    ));

    // ... further modify the response or return it directly

    return $response;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question