Download the PHP package dfox288/string-blade-compiler without Composer

On this page you can find all versions of the php package dfox288/string-blade-compiler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package string-blade-compiler

String Blade Compiler

Laravel 8 License

Render Blade templates from string value.

Reworked version to allow for array to be passed to the view function instead of template file name.

This is a direct extension of \Illuminate\View\View and is build to replace its usage. It will replace the default View instance.

Versions

String Blade Laravel Version
8.0 Laravel 10
6.0 Laravel 8
5.0 Laravel 7
4.0 Laravel 6
3.8 Laravel 5.8
3.7 Laravel 5.7
3.6 Laravel 5.6
3.5 Laravel 5.5
3.4 Laravel 5.4
3.3 Laravel 5.2
3.2 Laravel 5.1
2.* Laravel 5
1.* Laravel 4.2

Version 3.8 : Updates

The package has been completely rewritten, all code updated to be more in line with the Laravel version code. Several of the functions in the extended class were not needed and have been removed and the code has been cleaned up a bit.

Also updated the tests to what is available in Laravel View Tests. Some are not applicable to StringBlade.

Changes,

Installation

Add the package to composer.json:

"require": {
    ...
    "wpb/string-blade-compiler": "VERSION"
},

To get versions 'composer show wpb/string-blade-compiler', such as 'dev-master, * 3.2.x-dev, 3.2.0, 3.0.x-dev, 3.0.0, 2.1.0, 2.0.x-dev, 2.0.0, 1.0.x-dev, 1.0.0'

On packagist.org at https://packagist.org/packages/wpb/string-blade-compiler

composer require "wpb/string-blade-compiler"

Configuration

In config\app.php, providers section:

Both the ServiceProvider and Facade Alias are auto registered by Laravel. There is no need to add them to the /config/app.php file.

Replace 'Illuminate\View\ViewServiceProvider::class' with 'Wpb\String_Blade_Compiler\ViewServiceProvider::class',

This version does not require you to remove the registration of the original view component. Upon ServiceProvider registration it will replace the view binds with its self.

Laravel's Autoloader

There currently is a issue in Laravel's preload process of ServiceProviders. Service providers that are registered with the autoloaded are instantiated before service providers that are set in /config/app.php. This may cause problems in prior versions of StringBladeCompiler. The version has been rewitten to account for the autoloading process.

A pull request that would load vendor service providers registerd in the file before autoloads, was sent to Laravel/Framework and was rejected.

Config

Default cache time for the compiled string template is 300 seconds (5 mins), this can be changed in the config file, env file, or when calling a view. The change is global to all string templates.

STRING_BLADE_CACHE_TIMEOUT=300

Autoloading of blade custom directives can be changed in the config and env files.

STRING_BLADE_AUTOLOAD=false

Note: If using homestead or some other vm, the host handles the filemtime of the cache file. This means the vm may have a different time than the file. If the cache is not expiring as expected, check the times between the systems.

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.

New Config Option:

Laravel 5.8 BladeCompiler adds a php comment to the compiled template file . Since StringBladeCompiler does not have a "path" aka "template file location" that would be helpful to the developer. I have included a new config value, . This allows the developer to tag the StringBladeCompiler for where it is used. This is for if you end up digging in to the compiled view files, it would allow you to see a tag for StingBladeCompiler files.

Config Options:

Since StringBlade is a extend class from the original View. You should be able to do anything you would normally do with a View using StringBlade.

Blade::extend, for example :

As the compilers are set up as separate instances, if you need the extend on both the string and file template you will need to attach the extend (or directive) to both compilers.

Other options,

Deleting generated compiled cach view files (v3+).Set the delete flag for the compiler being used, stringblade or blade

I can't seem to find when the setting was actually used. If you want this, submit a bug and I will see about adding the ability.

License

string-blade-compiler is open-sourced software licensed under the MIT license


All versions of string-blade-compiler with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^8.0|^8.1
laravel/framework Version ^6.0|^7.0|^8.0|^9.0|^10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dfox288/string-blade-compiler contains the following files

Loading the files please wait ....