mirror of
https://github.com/grocy/grocy.git
synced 2026-03-27 23:29:25 +01:00
PHP packages cleanup
This commit is contained in:
parent
b5284a80c9
commit
634bae4930
4
app.php
4
app.php
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
use Grocy\Controllers\ExceptionController;
|
use Grocy\Controllers\ExceptionController;
|
||||||
use Grocy\Helpers\UrlManager;
|
use Grocy\Helpers\UrlManager;
|
||||||
|
use Grocy\Helpers\SlimBladeView;
|
||||||
use Grocy\Middleware\LocaleMiddleware;
|
use Grocy\Middleware\LocaleMiddleware;
|
||||||
use Grocy\Middleware\CorsMiddleware;
|
use Grocy\Middleware\CorsMiddleware;
|
||||||
use Psr\Container\ContainerInterface as Container;
|
use Psr\Container\ContainerInterface as Container;
|
||||||
use Slim\Factory\AppFactory;
|
use Slim\Factory\AppFactory;
|
||||||
use Slim\Views\Blade;
|
|
||||||
|
|
||||||
// Load composer dependencies
|
// Load composer dependencies
|
||||||
require_once __DIR__ . '/packages/autoload.php';
|
require_once __DIR__ . '/packages/autoload.php';
|
||||||
|
|
@ -84,7 +84,7 @@ $app = AppFactory::create();
|
||||||
$container = $app->getContainer();
|
$container = $app->getContainer();
|
||||||
$container->set('view', function (Container $container)
|
$container->set('view', function (Container $container)
|
||||||
{
|
{
|
||||||
return new Blade(__DIR__ . '/views', GROCY_DATAPATH . '/viewcache');
|
return new SlimBladeView(__DIR__ . '/views', GROCY_DATAPATH . '/viewcache');
|
||||||
});
|
});
|
||||||
|
|
||||||
$container->set('UrlManager', function (Container $container)
|
$container->set('UrlManager', function (Container $container)
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
{
|
{
|
||||||
"require": {
|
"require": {
|
||||||
"php": "8.5.*",
|
"php": "8.5.*",
|
||||||
"slim/slim": "^4.0",
|
|
||||||
"slim/psr7": "^1.0",
|
|
||||||
"slim/http": "^1.0",
|
|
||||||
"php-di/php-di": "^7.0.3",
|
|
||||||
"berrnd/slim-blade-view": "^1.0.0",
|
|
||||||
"morris/lessql": "dev-php82",
|
|
||||||
"gettext/gettext": "dev-4.x-fork",
|
|
||||||
"eluceo/ical": "^2.2.0",
|
"eluceo/ical": "^2.2.0",
|
||||||
"erusev/parsedown": "^1.7",
|
"erusev/parsedown": "^1.7",
|
||||||
"gumlet/php-image-resize": "^2.0",
|
|
||||||
"ezyang/htmlpurifier": "^4.13",
|
"ezyang/htmlpurifier": "^4.13",
|
||||||
"interficieis/php-barcode": "^2.0.2",
|
"gettext/gettext": "dev-4.x-fork",
|
||||||
|
"gumlet/php-image-resize": "^2.0",
|
||||||
"guzzlehttp/guzzle": "^7.0",
|
"guzzlehttp/guzzle": "^7.0",
|
||||||
"mike42/escpos-php": "^4.0"
|
"interficieis/php-barcode": "^2.0.2",
|
||||||
|
"mike42/escpos-php": "^4.0",
|
||||||
|
"morris/lessql": "dev-master-fork",
|
||||||
|
"php-di/php-di": "^7.0.3",
|
||||||
|
"slim/http": "^1.0",
|
||||||
|
"slim/psr7": "^1.0",
|
||||||
|
"slim/slim": "^4.0",
|
||||||
|
"webman/blade": "^1.5"
|
||||||
},
|
},
|
||||||
"repositories": [
|
"repositories": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
302
composer.lock
generated
302
composer.lock
generated
|
|
@ -4,125 +4,8 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "ef8208c97da190ec7d138910f95733f2",
|
"content-hash": "05efe482aa5f20f8a18e6be376ac3562",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
|
||||||
"name": "berrnd/slim-blade-view",
|
|
||||||
"version": "v1.2.1",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/berrnd/slim-blade-view.git",
|
|
||||||
"reference": "cf8a5718e0804801230d41d2f9a44e00a0d49376"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/berrnd/slim-blade-view/zipball/cf8a5718e0804801230d41d2f9a44e00a0d49376",
|
|
||||||
"reference": "cf8a5718e0804801230d41d2f9a44e00a0d49376",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"psr/http-message": "^1.0",
|
|
||||||
"ramsey/uuid": "^4.1.1",
|
|
||||||
"webman/blade": "^1.5.4"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "^4.0",
|
|
||||||
"slim/slim": "^4.0"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Slim\\Views\\": "src"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Bernd Bestel",
|
|
||||||
"email": "bernd@berrnd.de"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Hiroaki Matsuura",
|
|
||||||
"email": "lib2jp@gmail.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Fork of rubellum/Slim-Blade-View with Slim Framework v4 and Laravel Blade Templates v11 support",
|
|
||||||
"keywords": [
|
|
||||||
"blade",
|
|
||||||
"framework",
|
|
||||||
"renderer",
|
|
||||||
"slim",
|
|
||||||
"template",
|
|
||||||
"view"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"source": "https://github.com/berrnd/slim-blade-view/tree/v1.2.1"
|
|
||||||
},
|
|
||||||
"time": "2025-01-21T17:26:52+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "brick/math",
|
|
||||||
"version": "0.14.8",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/brick/math.git",
|
|
||||||
"reference": "63422359a44b7f06cae63c3b429b59e8efcc0629"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/brick/math/zipball/63422359a44b7f06cae63c3b429b59e8efcc0629",
|
|
||||||
"reference": "63422359a44b7f06cae63c3b429b59e8efcc0629",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": "^8.2"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"php-coveralls/php-coveralls": "^2.2",
|
|
||||||
"phpstan/phpstan": "2.1.22",
|
|
||||||
"phpunit/phpunit": "^11.5"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Brick\\Math\\": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"description": "Arbitrary-precision arithmetic library",
|
|
||||||
"keywords": [
|
|
||||||
"Arbitrary-precision",
|
|
||||||
"BigInteger",
|
|
||||||
"BigRational",
|
|
||||||
"arithmetic",
|
|
||||||
"bigdecimal",
|
|
||||||
"bignum",
|
|
||||||
"bignumber",
|
|
||||||
"brick",
|
|
||||||
"decimal",
|
|
||||||
"integer",
|
|
||||||
"math",
|
|
||||||
"mathematics",
|
|
||||||
"rational"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/brick/math/issues",
|
|
||||||
"source": "https://github.com/brick/math/tree/0.14.8"
|
|
||||||
},
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"url": "https://github.com/BenMorel",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"time": "2026-02-10T14:33:43+00:00"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "carbonphp/carbon-doctrine-types",
|
"name": "carbonphp/carbon-doctrine-types",
|
||||||
"version": "3.2.0",
|
"version": "3.2.0",
|
||||||
|
|
@ -1945,16 +1828,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "morris/lessql",
|
"name": "morris/lessql",
|
||||||
"version": "dev-php82",
|
"version": "dev-master-fork",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/berrnd/lessql.git",
|
"url": "https://github.com/berrnd/lessql.git",
|
||||||
"reference": "6e119fcf0e8145cd9b5e22fe030e147655acc4e3"
|
"reference": "bab1170a299ac39c63cb87abf8d1c3fc0cfe0b8c"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/berrnd/lessql/zipball/6e119fcf0e8145cd9b5e22fe030e147655acc4e3",
|
"url": "https://api.github.com/repos/berrnd/lessql/zipball/bab1170a299ac39c63cb87abf8d1c3fc0cfe0b8c",
|
||||||
"reference": "6e119fcf0e8145cd9b5e22fe030e147655acc4e3",
|
"reference": "bab1170a299ac39c63cb87abf8d1c3fc0cfe0b8c",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
|
@ -1964,6 +1847,7 @@
|
||||||
"friendsofphp/php-cs-fixer": "^2.16",
|
"friendsofphp/php-cs-fixer": "^2.16",
|
||||||
"phpunit/phpunit": "~4.6|~5|~6|~7"
|
"phpunit/phpunit": "~4.6|~5|~6|~7"
|
||||||
},
|
},
|
||||||
|
"default-branch": true,
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|
@ -1997,9 +1881,9 @@
|
||||||
"sql"
|
"sql"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/berrnd/lessql/tree/php82"
|
"source": "https://github.com/berrnd/lessql/tree/master-fork"
|
||||||
},
|
},
|
||||||
"time": "2023-08-01T19:13:22+00:00"
|
"time": "2026-03-04T18:42:48+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "nesbot/carbon",
|
"name": "nesbot/carbon",
|
||||||
|
|
@ -2494,16 +2378,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/http-message",
|
"name": "psr/http-message",
|
||||||
"version": "1.1",
|
"version": "2.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/php-fig/http-message.git",
|
"url": "https://github.com/php-fig/http-message.git",
|
||||||
"reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba"
|
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
|
"url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
|
||||||
"reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
|
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
|
@ -2512,7 +2396,7 @@
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "1.1.x-dev"
|
"dev-master": "2.0.x-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
|
@ -2527,7 +2411,7 @@
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "PHP-FIG",
|
"name": "PHP-FIG",
|
||||||
"homepage": "http://www.php-fig.org/"
|
"homepage": "https://www.php-fig.org/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Common interface for HTTP messages",
|
"description": "Common interface for HTTP messages",
|
||||||
|
|
@ -2541,9 +2425,9 @@
|
||||||
"response"
|
"response"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/php-fig/http-message/tree/1.1"
|
"source": "https://github.com/php-fig/http-message/tree/2.0"
|
||||||
},
|
},
|
||||||
"time": "2023-04-04T09:50:52+00:00"
|
"time": "2023-04-04T09:54:51+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/http-server-handler",
|
"name": "psr/http-server-handler",
|
||||||
|
|
@ -2803,160 +2687,6 @@
|
||||||
},
|
},
|
||||||
"time": "2019-03-08T08:55:37+00:00"
|
"time": "2019-03-08T08:55:37+00:00"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "ramsey/collection",
|
|
||||||
"version": "2.1.1",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/ramsey/collection.git",
|
|
||||||
"reference": "344572933ad0181accbf4ba763e85a0306a8c5e2"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/ramsey/collection/zipball/344572933ad0181accbf4ba763e85a0306a8c5e2",
|
|
||||||
"reference": "344572933ad0181accbf4ba763e85a0306a8c5e2",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": "^8.1"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"captainhook/plugin-composer": "^5.3",
|
|
||||||
"ergebnis/composer-normalize": "^2.45",
|
|
||||||
"fakerphp/faker": "^1.24",
|
|
||||||
"hamcrest/hamcrest-php": "^2.0",
|
|
||||||
"jangregor/phpstan-prophecy": "^2.1",
|
|
||||||
"mockery/mockery": "^1.6",
|
|
||||||
"php-parallel-lint/php-console-highlighter": "^1.0",
|
|
||||||
"php-parallel-lint/php-parallel-lint": "^1.4",
|
|
||||||
"phpspec/prophecy-phpunit": "^2.3",
|
|
||||||
"phpstan/extension-installer": "^1.4",
|
|
||||||
"phpstan/phpstan": "^2.1",
|
|
||||||
"phpstan/phpstan-mockery": "^2.0",
|
|
||||||
"phpstan/phpstan-phpunit": "^2.0",
|
|
||||||
"phpunit/phpunit": "^10.5",
|
|
||||||
"ramsey/coding-standard": "^2.3",
|
|
||||||
"ramsey/conventional-commits": "^1.6",
|
|
||||||
"roave/security-advisories": "dev-latest"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"captainhook": {
|
|
||||||
"force-install": true
|
|
||||||
},
|
|
||||||
"ramsey/conventional-commits": {
|
|
||||||
"configFile": "conventional-commits.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Ramsey\\Collection\\": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Ben Ramsey",
|
|
||||||
"email": "ben@benramsey.com",
|
|
||||||
"homepage": "https://benramsey.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "A PHP library for representing and manipulating collections.",
|
|
||||||
"keywords": [
|
|
||||||
"array",
|
|
||||||
"collection",
|
|
||||||
"hash",
|
|
||||||
"map",
|
|
||||||
"queue",
|
|
||||||
"set"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/ramsey/collection/issues",
|
|
||||||
"source": "https://github.com/ramsey/collection/tree/2.1.1"
|
|
||||||
},
|
|
||||||
"time": "2025-03-22T05:38:12+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ramsey/uuid",
|
|
||||||
"version": "4.9.2",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/ramsey/uuid.git",
|
|
||||||
"reference": "8429c78ca35a09f27565311b98101e2826affde0"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/ramsey/uuid/zipball/8429c78ca35a09f27565311b98101e2826affde0",
|
|
||||||
"reference": "8429c78ca35a09f27565311b98101e2826affde0",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"brick/math": "^0.8.16 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13 || ^0.14",
|
|
||||||
"php": "^8.0",
|
|
||||||
"ramsey/collection": "^1.2 || ^2.0"
|
|
||||||
},
|
|
||||||
"replace": {
|
|
||||||
"rhumsaa/uuid": "self.version"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"captainhook/captainhook": "^5.25",
|
|
||||||
"captainhook/plugin-composer": "^5.3",
|
|
||||||
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
|
|
||||||
"ergebnis/composer-normalize": "^2.47",
|
|
||||||
"mockery/mockery": "^1.6",
|
|
||||||
"paragonie/random-lib": "^2",
|
|
||||||
"php-mock/php-mock": "^2.6",
|
|
||||||
"php-mock/php-mock-mockery": "^1.5",
|
|
||||||
"php-parallel-lint/php-parallel-lint": "^1.4.0",
|
|
||||||
"phpbench/phpbench": "^1.2.14",
|
|
||||||
"phpstan/extension-installer": "^1.4",
|
|
||||||
"phpstan/phpstan": "^2.1",
|
|
||||||
"phpstan/phpstan-mockery": "^2.0",
|
|
||||||
"phpstan/phpstan-phpunit": "^2.0",
|
|
||||||
"phpunit/phpunit": "^9.6",
|
|
||||||
"slevomat/coding-standard": "^8.18",
|
|
||||||
"squizlabs/php_codesniffer": "^3.13"
|
|
||||||
},
|
|
||||||
"suggest": {
|
|
||||||
"ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.",
|
|
||||||
"ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.",
|
|
||||||
"ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.",
|
|
||||||
"paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter",
|
|
||||||
"ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type."
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"captainhook": {
|
|
||||||
"force-install": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"files": [
|
|
||||||
"src/functions.php"
|
|
||||||
],
|
|
||||||
"psr-4": {
|
|
||||||
"Ramsey\\Uuid\\": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"description": "A PHP library for generating and working with universally unique identifiers (UUIDs).",
|
|
||||||
"keywords": [
|
|
||||||
"guid",
|
|
||||||
"identifier",
|
|
||||||
"uuid"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/ramsey/uuid/issues",
|
|
||||||
"source": "https://github.com/ramsey/uuid/tree/4.9.2"
|
|
||||||
},
|
|
||||||
"time": "2025-12-14T04:43:48+00:00"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "slim/http",
|
"name": "slim/http",
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
|
|
|
||||||
34
helpers/SlimBladeView.php
Normal file
34
helpers/SlimBladeView.php
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Grocy\Helpers;
|
||||||
|
|
||||||
|
use Jenssegers\Blade\Blade;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
|
class SlimBladeView
|
||||||
|
{
|
||||||
|
public function __construct(string $viewPaths, string $cachePath)
|
||||||
|
{
|
||||||
|
$this->ViewPaths = $viewPaths;
|
||||||
|
$this->CachePath = $cachePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected $ViewPaths;
|
||||||
|
protected $CachePath;
|
||||||
|
protected $ViewData = [];
|
||||||
|
|
||||||
|
public function render(ResponseInterface $response, string $template, array $data = [])
|
||||||
|
{
|
||||||
|
$data = array_merge($this->ViewData, $data);
|
||||||
|
$renderer = new Blade($this->ViewPaths, $this->CachePath, null);
|
||||||
|
$output = $renderer->make($template, $data)->render();
|
||||||
|
|
||||||
|
$response->getBody()->write($output);
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set(string $key, mixed $value)
|
||||||
|
{
|
||||||
|
$this->ViewData[$key] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user