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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Flynsarmy/DbBladeCompiler/DbBladeCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public function __construct($filesystem, $cache_path, Repository $config)
$blade = app('view')->getEngineResolver()->resolve('blade')->getCompiler();

parent::__construct($filesystem, $cache_path);
$this->rawTags = $blade->getRawTags();
$this->contentTags = $blade->getContentTags();
$this->escapedTags = $blade->getEscapedContentTags();
$this->rawTags = $blade->rawTags;
$this->contentTags = array_map('stripcslashes', $blade->contentTags);
$this->escapedTags = array_map('stripcslashes', $blade->escapedTags);
$this->extensions = $blade->getExtensions();
$this->customDirectives = $blade->getCustomDirectives();
$this->config = $config;
Expand Down
2 changes: 1 addition & 1 deletion src/Flynsarmy/DbBladeCompiler/DbView.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function render(Closure $callback = null)
// Once we have the contents of the view, we will flush the sections if we are
// done rendering all views so that there is nothing left hanging over when
// anothoer view is rendered in the future by the application developers.
View::flushSectionsIfDoneRendering();
( str_contains( app()->version(), ['5.3','5.2', '5.1']) ? View::flushSectionsIfDoneRendering() : View::flushStateIfDoneRendering());

return $response ?: $contents;
}
Expand Down