Compare commits
4 Commits
956f791a0d
...
master
Author | SHA1 | Date | |
---|---|---|---|
2c05ea95b4 | |||
f97f9e3c2a | |||
f083f9553c | |||
6a7b98f869 |
@ -1,7 +1,4 @@
|
||||
# Slim-Blade-View
|
||||
|
||||
[](https://travis-ci.org/rubellum/Slim-Blade-View)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
# Slim-Views-Blade
|
||||
|
||||
This is a Slim Framework view helper built on top of the Blade component.
|
||||
|
||||
@ -12,10 +9,10 @@ You can use this component to create and render templates in your Slim Framework
|
||||
Via [Composer](https://getcomposer.org/)
|
||||
|
||||
```bash
|
||||
$ composer require rubellum/slim-blade-view
|
||||
$ composer require provm/slim-views-blade
|
||||
```
|
||||
|
||||
Requires Slim Framework 3 and PHP 5.5.0 or newer.
|
||||
Requires Slim Framework 4 and PHP 7 or newer.
|
||||
|
||||
## Usage
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "rubellum/slim-blade-view",
|
||||
"name": "provm/slim-views-blade",
|
||||
"type": "library",
|
||||
"description": "Slim Framework 3 view helper built on the Blade component",
|
||||
"description": "Slim Framework 4 view helper built on the Blade component",
|
||||
"keywords": [
|
||||
"slim",
|
||||
"framework",
|
||||
"view",
|
||||
"views",
|
||||
"template",
|
||||
"blade",
|
||||
"renderer"
|
||||
@ -13,14 +13,12 @@
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Hiroaki Matsuura",
|
||||
"email": "lib2jp@gmail.com"
|
||||
"name": "Aldarien",
|
||||
"email": "aldarien85@gmail.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"illuminate/view": "5.*",
|
||||
"philo/laravel-blade": "3.*",
|
||||
"psr/http-message": "^1.0"
|
||||
"eftec/bladeone": "^4"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
@ -29,6 +27,6 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.0",
|
||||
"slim/slim": "^3.0"
|
||||
"slim/slim": "^4.0"
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"require": {
|
||||
"slim/slim": "^3.0",
|
||||
"rubellum/slim-blade-view": "^0.1.1"
|
||||
"slim/slim": "^4.0",
|
||||
"provm/slim-views-blade": "^1"
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace Slim\Views;
|
||||
|
||||
use Illuminate\Events\Dispatcher;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use eftec\bladeone\BladeOne;
|
||||
|
||||
class Blade
|
||||
{
|
||||
@ -17,11 +17,6 @@ class Blade
|
||||
*/
|
||||
protected $cachePath;
|
||||
|
||||
/**
|
||||
* @var Dispatcher|null
|
||||
*/
|
||||
protected $events;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
@ -31,16 +26,15 @@ class Blade
|
||||
* Blade constructor.
|
||||
* @param array $viewPaths
|
||||
* @param $cachePath
|
||||
* @param Dispatcher|null $events
|
||||
* @param array $attributes
|
||||
*/
|
||||
public function __construct($viewPaths = [], $cachePath = '', Dispatcher $events = null, $attributes = [])
|
||||
public function __construct($viewPaths = [], $cachePath = '', $attributes = [])
|
||||
{
|
||||
if (is_string($viewPaths)) {
|
||||
$viewPaths = [$viewPaths];
|
||||
}
|
||||
$this->viewPaths = $viewPaths;
|
||||
$this->cachePath = $cachePath;
|
||||
$this->events = $events;
|
||||
$this->attributes = $attributes;
|
||||
}
|
||||
|
||||
@ -169,7 +163,8 @@ class Blade
|
||||
|
||||
$data = array_merge($this->attributes, $data);
|
||||
|
||||
$renderer = new \Philo\Blade\Blade($this->viewPaths, $this->cachePath, $this->events);
|
||||
return $renderer->view()->make($template, $data)->render();
|
||||
//$renderer = new \Philo\Blade\Blade($this->viewPaths, $this->cachePath, $this->events);
|
||||
$renderer = new BladeOne($this->getViewPaths(), $this->getCachePath());
|
||||
return $renderer->run($template, $data);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user