public function filter(Application $app, Response $resp) { if ($resp instanceof TransientResponse) { if ($resp->getTemplate()->hasBlock($this->block)) { $this->injectLocalizations(); } } }
/** * [ 'key' => 'foo', 'value' => 'bar' ] => [ 'foo' => 'bar' ] * [ 'key' => 'foo', 'value' => 'bar', 'value2' => 'baz' ] => [ 'foo' => [ 'value' => 'bar', 'value2' => 'baz' ] ] */ public function filter(Application $app, Response $resp) { if ($resp instanceof TransientResponse) { if ($resp->getTemplate()->hasBlock($this->block)) { $app[$this->block] = $this->getSet(); } } }