Skip to content

[5.4] Let PHP parse @renderWhen - #18285

Merged
taylorotwell merged 1 commit into
laravel:5.4from
themsaid:renderWhenFix
Mar 13, 2017
Merged

taylorotwell merged 1 commit into
laravel:5.4from
themsaid:renderWhenFix

Conversation

@themsaid

@themsaid themsaid commented Mar 9, 2017

Copy link
Copy Markdown
Member

In this PR we'll just let the directive call a renderWhen method in the view factory that'll handle checking the condition and render the view if it's true.

@deleugpn

deleugpn commented Mar 19, 2017 •

Copy link
Copy Markdown
Contributor

Is it possible to get this PR? I'm on 5.4.15, but it seems like this will need to be added on a new release version before being able to get it from composer update. I found a bug with the original implementation and this PR fixes the bug.

On a clean install of Laravel 5.4.15, if you use includeWhen(condition(), 'view', ['parameters' => 'value']), it fails because the original regex will group the condition() together with the view and try to make a view out of the parameters as shown here.

salmanarshad321 pushed a commit to salmanarshad321/framework that referenced this pull request Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants