Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate injections after rendering methods #137

Closed
Gerych1984 opened this issue Dec 17, 2024 · 0 comments · Fixed by yiisoft/view#278 or #138
Closed

Duplicate injections after rendering methods #137

Gerych1984 opened this issue Dec 17, 2024 · 0 comments · Fixed by yiisoft/view#278 or #138

Comments

@Gerych1984
Copy link

Gerych1984 commented Dec 17, 2024

When using custom injectors that allow the user to add links/meta tags, when multiple render* methods are called, subsequent calls to getLinkTags/getMetaTags are also duplicated. For example:

public function index(SomeLinkTagsInjectionInterface $injection): ResponseInterface 
{
        $injection->addSomeLink('href', 'rel');
        $content = $this->viewRenderer->renderPartialAsString('index');

        return $this->render($content);
}

As result link tag rendered twice in layout head

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants