Changed structure

This commit is contained in:
2021-10-13 21:57:32 -03:00
parent 956f791a0d
commit 6a7b98f869
4 changed files with 17 additions and 28 deletions

View File

@ -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

View File

@ -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"
}
}

View File

@ -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"
}
}

View File

@ -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);
}
}