8000 Allow using multiple template candidates when rendering twig template (like include) · Issue #9071 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Allow using multiple template candidates when rendering twig template (like include) #9071

@Koc

Description

@Koc
// there is no possibility do smth like this
$templates = array(
    sprintf('MissProjectBundle:StaticPage:custom/%s', $page['template']),
    'MissProjectBundle:StaticPage:static_page_layout.html.twig'
);

return $this->render($templates);

// and we should use workaround
return new Response($this->get('twig')->resolveTemplate($templates)->render(array()));

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0