diff --git a/README.md b/README.md index 497b2c0..b5a21aa 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,4 @@ -# Slim-Blade-View - -[![Build Status](https://travis-ci.org/rubellum/Slim-Blade-View.svg?branch=master)](https://travis-ci.org/rubellum/Slim-Blade-View) -[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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 diff --git a/composer.json b/composer.json index caadb42..f1e2fdb 100644 --- a/composer.json +++ b/composer.json @@ -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" } } \ No newline at end of file diff --git a/example/composer.json b/example/composer.json index c0de0c5..beb5923 100644 --- a/example/composer.json +++ b/example/composer.json @@ -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" } } diff --git a/src/Blade.php b/src/Blade.php index ee5efc9..95363e1 100644 --- a/src/Blade.php +++ b/src/Blade.php @@ -2,7 +2,6 @@ namespace Slim\Views; -use Illuminate\Events\Dispatcher; use Psr\Http\Message\ResponseInterface; class Blade @@ -17,11 +16,6 @@ class Blade */ protected $cachePath; - /** - * @var Dispatcher|null - */ - protected $events; - /** * @var array */ @@ -31,16 +25,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 +162,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); } } \ No newline at end of file