Skip to content

Feature/laravel 5 4 compatibility blade compiler #29

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

Merged
merged 3 commits into from
Feb 25, 2017
Merged

Feature/laravel 5 4 compatibility blade compiler #29

merged 3 commits into from
Feb 25, 2017

Conversation

jp-davy
Copy link
Contributor

@jp-davy jp-davy commented Feb 24, 2017

This is my first open source contribution, so hopefully I'm doing this correctly (not quite sure here).

This adds more compatibility with L5.4, and (hopefully) fixes the Call to undefined method Illuminate\View\Factory::flushSectionsIfDoneRendering() issue.

One change I made is in DbView class, line 77. Changed to check which version of Laravel is being used, and calls appropriate method based on the version.

The Second change I made was in DbBladeCompiler class, lines 20-22. It looks like in L5.4 the accessor methods were removed from the BladeCompiler, so I just grabbed the values straight from the protected attributes. The contentTags, and escapedTags in L5.3 were being called by getTags() method, which did an array_map('stripcslashes'). I just called that on the attributes.

flushSectionsIfDoneRendering() method no longer in L5.4
Use flushStateIfDoneRendering() instead
getRawTags(), getContentTags(), getEscapedContentTags() methods are no longer in the L5.4 BladeCompiler.

Changed to just get the protected values from the class, no longer using the accessor methods.

On contentTags, and escapedTags use array_map('stripcslashes'). This matches the functionality in L5.3 BladeCompiler -- (see method getTags() in L5.3 Illuminate\View\Compilers\BladeCompiler).
Revised for backwards compatibility with L5.3, 5.2, 5.1
@Flynsarmy Flynsarmy merged commit e21ea87 into Flynsarmy:master Feb 25, 2017
@Flynsarmy
Copy link
Owner

Thanks!

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.

2 participants