Recommend this page to a friend! |
![]() |
Info | Documentation | ![]() |
![]() |
![]() |
Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 19 | All time: 11,370 This week: 57![]() |
Version | License | PHP version | Categories | |||
laravel-blitz-view 1.0 | GNU General Publi... | 5 | PHP 5, Libraries, Cache |
Description | Author | ||||||||||||||
This package provides a caching service to Laravel application views. |
|
Facade for Blitz template PHP extensions.
Default cache type is "file", prepared templates store into laravel "storage/blitz_compiled" folder (may change in config). By default, caching is disabled, you may change "cache_enabled" to "true" in "config/blitz.php"
Require this package with Composer
$ composer require nickyx3/blitz
Then run
$ php artisan vendor:publish --provider="NickyX3\Blitz\Providers\BlitzServiceProvider"
Default configuration
'templates_folder' => 'blitz_view',
'cache_type' => 'file',
'cache_enabled' => false,
'compiled_folder' => 'blitz_compiled',
'scope_lookup_limit' => 8,
'php_callbacks_first' => 1,
'namespace_finder' => [
'App\Helpers',
'Illuminate\Support',
'Illuminate\Support\Facades'
]
Example Controller
use NickyX3\Blitz\Facade\BlitzView;
Route::get('/', function () {
return BlitzView::apply('example.blitz-extend',['title'=>'Blitz Title']);
});
Method `
apply`
returns `
Illuminate\Http\Response`
, also method `
make`
is alias for `
apply`
The command is also available to clear the template cache
$ php artisan blitz:clear
If Blitz generate error, throw custom BlitzException with integrated renderer.
This exception will be rendered if your env `
APP_DEBUG=true`
, otherwise simple laravel error 500 with abort helper.
Unlike Blitz, which can only do include, template "up" inheritance works like in Blade Engine.
The following Blade directives are supported: `
@yield`
, `
@extends`
, `
@section`
and `
@endsection`
placed in an HTML comment tag
"example/master.tpl" template
<!DOCTYPE html>
<html lang="en">
<body>
<!-- @yield('content') -->
</body>
</html>
"blitz-extend.tpl" template
<!-- @extends('example.master') -->
<!-- @section('content') -->
<div class="child-template">this is template extends example/master.tpl</div>
<!-- @endsection -->
Perhaps the code is not very good, I'm new to Laravel and also very poorly documented because I'm going on vacation. Maybe I'll make detailed comments later :-)
Additions and corrections welcome
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Doc. | Documentation |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
![]() |
![]() | laravel-blitz-view-2022-08-22.zip 19KB |
![]() | laravel-blitz-view-2022-08-22.tar.gz 14KB |
![]() | Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.