Skip to content

cambio para Laravel 5.4 php 7.2 #2

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{
"name": "digivo/laravel-string-blade-compiler",
"name": "bilaliqbalr/laravel-string-blade-compiler",
"description": "Render Blade templates from a string",
"keywords": ["laravel", "blade", "compiler", "eloquent", "model"],
"license": "MIT",
"authors": [
{
"name": "Bilal",
"email": "[email protected]",
"homepage": "https://phalcosoft.com"
},
{
"name": "Digivo",
"email": "[email protected]"
Expand All @@ -23,7 +28,7 @@
},
"autoload": {
"psr-0": {
"Digivo\\StringBladeCompiler\\": "src/"
"Bilaliqbalr\\StringBladeCompiler\\": "src/"
}
},
"minimum-stability": "stable"
Expand Down
10 changes: 5 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ Originally forked from [Flynsarmy/laravel-db-blade-compiler](https://github.com/

This package generates and returns a compiled view from a provided string

### Installation (Laravel 5.x)
### Installation (Laravel 5.4.x)

Require this package in your composer.json and run composer update (or run `composer require digivo/laravel-string-blade-compiler:1.*` directly):
Require this package in your composer.json and run composer update (or run `composer require bilaliqbalr/laravel-string-blade-compiler:1.*` directly):

"digivo/laravel-string-blade-compiler": "1.*"
"bilaliqbalr/laravel-string-blade-compiler": "1.*"

After updating composer, add the ServiceProvider to the providers array in app/config/app.php

'Digivo\StringBladeCompiler\StringBladeCompilerServiceProvider',
Bilaliqbalr\StringBladeCompiler\StringBladeCompilerServiceProvider::class,

and the Facade to the aliases array in the same file

'StringView' => 'Digivo\StringBladeCompiler\Facades\DigivoView',
'StringView' => Bilaliqbalr\StringBladeCompiler\Facades\StringView::class,

You have to also publish the config-file

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Digivo\StringBladeCompiler\Facades;
<?php
namespace Bilaliqbalr\StringBladeCompiler\Facades;

use Illuminate\Support\Facades\Facade;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Digivo\StringBladeCompiler;
<?php
namespace Bilaliqbalr\StringBladeCompiler;

use Illuminate\View\Compilers\BladeCompiler;
use Illuminate\View\Compilers\CompilerInterface;
Expand All @@ -16,10 +16,10 @@ public function __construct($filesystem, $cache_path, $config, $app)
$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->extensions = $blade->getExtensions();
$this->rawTags = $blade->rawTags;
$this->contentTags = $blade->contentTags;
$this->escapedTags = $blade->escapedTags;
$this->extensions = $blade->extensions;
$this->customDirectives = $blade->getCustomDirectives();
$this->config = $config;
}
Expand Down Expand Up @@ -54,7 +54,7 @@ public function getCompiledPath($path)
*
* e.g db_table_name_id_4
*/
return $this->cachePath . '/' . md5($path);
return $this->cachePath . '/' . md5($path) . '.php';
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Digivo\StringBladeCompiler;
<?php
namespace Bilaliqbalr\StringBladeCompiler;

use Illuminate\Support\ServiceProvider;
use Illuminate\View\Engines\CompilerEngine;
Expand Down Expand Up @@ -49,7 +49,7 @@ public function register()
});
$this->app->booting(function () {
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
$loader->alias('StringView', 'Digivo\StringBladeCompiler\Facades\StringView');
$loader->alias('StringView', 'Bilaliqbalr\StringBladeCompiler\Facades\StringView');
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Digivo\StringBladeCompiler;
<?php
namespace Bilaliqbalr\StringBladeCompiler;

use View;
use Closure;
Expand Down Expand Up @@ -55,7 +55,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();
View::flushSections();

return $response ?: $contents;
}
Expand Down