https://github.com/lee-to/spiral-blade-bridge
https://github.com/lee-to/spiral-blade-bridge
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lee-to/spiral-blade-bridge
- Owner: lee-to
- License: mit
- Created: 2024-02-06T08:04:48.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-02-08T04:48:55.000Z (over 1 year ago)
- Last Synced: 2024-12-28T11:30:24.796Z (5 months ago)
- Language: PHP
- Size: 5.86 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spiral Framework: Blade Adapter
## Installation
```
composer require lee-to/spiral-blade-bridge
```To enable extension modify your application by adding `Leeto\SpiralBlade\Bootloader\BladeBootloader`:
```php
use Leeto\SpiralBlade\Bootloader\BladeBootloader;
class Kernel extends \Spiral\Framework\Kernel
{
// ..public function defineBootloaders(): array
{
return [
// ..
// Views
BladeBootloader::class,
// ..
];
}// ..
}
```## Configuration
Publish the config to `app/config/views/blade.php`
and you can add your class components and anonymous ones as well as directives```php
return [
'paths' => [
// 'custom' => directory('root') . 'packages/custom/views',
'app' => directory('root') . 'app/views',
],
'cache_dir' => directory('runtime') . 'cache/views',
'component_namespaces' => [
// 'VendorName\Components' => 'prefix'
],
'anonymous_component_namespaces' => [
// directory('root') . 'packages/prefix/views/components' => 'prefix',
],
'directives' => [
// MyCustomDirective::class,
],
];
```## Directive
Add a class that implements the Leeto\SpiralBlade\DirectiveInterface interface and add it to the config
```php
"format('m/d/Y H:i'); ?>";
}
}
```