public function view($callback, $priority = 0)
    {
        $this->on(KernelEvents::VIEW, new ViewListenerWrapper($this, $callback), $priority);
    }
public function view($callback, $priority = 0)
    {
        $this->on(KernelEvents::VIEW, new ViewListenerWrapper($this, $callback), $priority);
    }
public function view ( $ callback , $ priority = 0 ) { $ this -> on ( KernelEvents :: VIEW , new ViewListenerWrapper ( $ this , $ callback ) , $ priority ) ; }
Registers a view handler.

View handlers are simple callables which take a controller result and the
request as arguments, whenever a controller returns a value that is not
an instance of Response. When this occurs, all suitable handlers will be
called, until one returns a Response object.

@param mixed $callback View handler callback
@param int   $priority The higher this value, the earlier an event
listener will be triggered in the chain (defaults to 0)
Registers a view handler .