2017 © Pedro Peláez
 

library string-blade-compiler

Render Blade templates from string

image

esdlabs/string-blade-compiler

Render Blade templates from string

  • Monday, February 2, 2015
  • by edgarnadal
  • Repository
  • 3 Watchers
  • 0 Stars
  • 6,840 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 33 Forks
  • 0 Open issues
  • 6 Versions
  • 13 % Grown

The README.md

String Blade Compiler

Render Blade templates from string value., (*1)

This is a fork from https://github.com/Flynsarmy/laravel-db-blade-compiler which uses Elequent model to pass in a template., (*2)

I have reworked it to allow for a generic array of the required fields to generates and return a compiled view from a blade-syntax template., (*3)

Update

Updated to support Laravel 5-dev. To use in 4.2 change use Illuminate\Contracts\View\View as ViewContract; back to use Illuminate\Support\Contracts\RenderableInterface as Renderable; in StringBladeCompiler\StringView.php, (*4)

Installation

(I'm unsure how to move the code from laravel 4 workbench to vendor), (*5)

My current path is app\workbench\wpb\string-blade-compiler, (*6)

Add the ServiceProvider to the providers array in app/config/app.php, (*7)

'Wpb\StringBladeCompiler\StringBladeCompilerServiceProvider',, (*8)

There is no need to add a Facade to the aliases array in the same file as the service provider, this is being included automatically in the ServiceProvider., (*9)

Usage

This package offers a StringView facade with the same syntax as View but accepts a Array or Array Object instance instead of path to view., (*10)

return StringView::make(
                        array(
                            // this actual blade template
                            'template'  => '{{ $token1 }}',
                            // this is the cache file key, converted to md5
                            'cache_key' => 'my_unique_cache_key',
                            // timestamp for when the template was last updated, 0 is always recompile
                            'updated_at' => 1391973007
                        ),
                        array(
                            'token1'=> 'token 1 value'
                        )
                );

License

string-blade-compiler is open-sourced software licensed under the MIT license, (*11)

The Versions

02/02 2015

1.0.x-dev

1.0.9999999.9999999-dev

Render Blade templates from string

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Edgar Nadal
by Terre Porter

laravel blade compiler

02/02 2015

v1.0.1

1.0.1.0

Render Blade templates from string

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Edgar Nadal
by Terre Porter

laravel blade compiler

02/02 2015

v1.0.0

1.0.0.0

Render Blade templates from string

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Edgar Nadal
by Terre Porter

laravel blade compiler

24/01 2015

2.0.x-dev

2.0.9999999.9999999-dev

Render Blade templates from string

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Terre Porter

laravel blade compiler

24/01 2015

v2.0.0

2.0.0.0

Render Blade templates from string

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Terre Porter

laravel blade compiler

20/09 2014

dev-master

9999999-dev

Render Blade templates from string

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Terre Porter

laravel blade compiler