Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Check if templating engine supports given view#40373

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:4.4fromfritzmg:fix-template-engine-rendering
Mar 12, 2021

Conversation

@fritzmg
Copy link
Contributor

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

Currently theControllerTrait::render andControllerTrait::renderView methods assume that when thetemplating service is available it can always render the given view via that service.

However, that might not be the case. For example ifframework.templating is not configured to support thetwig engine for example but only some other custom engine, e.g.

framework:templating:engines:       -foobar

it will fail when the given view references a Twig template for instance and the configured engine cannot render that.

TheSymfony\Component\Templating\EngineInterface whichtemplating implements defines asupport method:

/**
* Returns true if this class is able to render the given template.
*
* @param string|TemplateReferenceInterface $name A template name or a TemplateReferenceInterface instance
*
* @return bool true if this class supports the given template, false otherwise
*/
publicfunctionsupports($name);

which should be used here, in order to make sure thattemplating actually does support rendering the given view.

ro0NL reacted with thumbs up emoji
@fabpot
Copy link
Member

Thank you@fritzmg.

@fabpotfabpot merged commitfb670df intosymfony:4.4Mar 12, 2021
@fritzmgfritzmg deleted the fix-template-engine-rendering branchMarch 12, 2021 09:27
This was referencedMar 29, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

3 participants

@fritzmg@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp