Download the PHP package pinkcrab/bladeone-provider without Composer

On this page you can find all versions of the php package pinkcrab/bladeone-provider. 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 bladeone-provider

BladeOne_Provider

A BladeOne Provider for the PinkCrab Renderable Interface.

Latest Stable Version Total Downloads License PHP Version Require GitHub contributors GitHub issues

WP5.9 [PHP7.2-8.1] Tests WP6.0 [PHP7.2-8.1] Tests WP6.1 [PHP7.2-8.1] Tests

codecov Scrutinizer Code Quality Maintainability

Supports and tested with the PinkCrab Perique Framework versions 1.4.*

Why?

The BladeOne implementation of the Renderable interface, allows the use of Blade within the PinkCrab Framework.

Setup

`

The simplest way to enable BladeOne is to use the BladeOne_Bootstrap helper class, this will configure BladeOne fully for use as the Renderable implementation. To use this just include the following before Perique is setup in your plugin.php file for plugins or functions.php for themes.

\$views_path :: This can be a string or an array of strings. If an array is passed, the first path that exists will be used. If not passed, the path defined in Perique will be used.

\$cache_path :: This should be a string path to the cache directory. If not passed, the path will be set as the WP_CONTENT_DIR . 'uploads/compiled/blade'

\$blade_mode :: For more details on the options please see official docs

\$blade_class :: This should be a the class name or instance of a class that extends PinkCrab_BladeOne::class this allows for the creation of custom components and extending BladeOne in general. For more details please see official docs Passing nothing or an invalid type will just use the default PinkCrab_BladeOne.

If the cache directory doesn't exist, BladeOne will create it for you. It is however best to do this yourself to be sure of permissions etc.

Included Components

Out of the box PinkCrab_BladeOne comes with the BladeOneHTML trait added, giving access all HTML components. BladeOneHTML Docs

Configuring BladeOne

At its core BladeOne is a single class representation of Blade and most of its core functionality. To make configuration possible when being injected from DI Container we have a custom class you can extend and add to the registration array like any other Hookable class.

You can have as many of these config classes as you want, allowing you to break up any custom directives, globals values and aliases etc.

Public Methods

The BladeOne_Provider class has a number of methods which can be used to configure the underlying BladeOne implementation. This can be done using the config() method as part of the Config class above.


allow_pipe

Calling this will allow you toggle piping {{ $var | esc_html }} on or off. By default this is enabled.
Details: https://github.com/EFTEC/BladeOne/wiki/Template-Pipes-\(Filter)


directive

Calling this will allow you to create custom directives

Details: https://github.com/EFTEC/BladeOne/wiki/Methods-of-the-class#directive

Don't forget our config class is loaded via the DI Container, so you can encapsulate your Directive callbacks into a class, with dependencies injected using the DI Container. (See above example)

directive_rt

Calling this will allow you to create custom directives


add_include

This will allow you to set alias for your templates, this is ideal for global variables (share()).


add_alias_classes

This allows for the creation of simpler and short class names for use in templates.


share

Allows fore the creation of globals variable. This is best set in the Config class (detailed above) as you can pass in dependencies.

You do not need to defined \$GLOBAL_foo when you are passing values to render \$foo->render('template.path', [])

Details: https://github.com/EFTEC/BladeOne/wiki/Methods-of-the-class#share


set_mode

Allows for the setting of a custom rendering mode. used MODE_AUTO by default.


set_file_extension

Allows you to define a custom extension for your blade templates.


set_compiled_extension

Allows you to define a custom extension for your compiled views.


set_esc

Allows you to define a custom esc function for your views. By default this is set to esc_html.


Magic Call Methods

The BladeOne class has a large selection of Static and regular methods, these can all be accessed from BladeOne_Provider. These can be called as follows.

For the complete list of methods, please visit https://github.com/EFTEC/BladeOne/wiki/Methods-of-the-class

If you want access none static methods using a static means, you can use

callingengine() on view, will return the underlying rendering engine used, in this case the BladeOne_Provider.

Of course you can set the engine it self as a global variable using $provider->share('view_helper', [App::view(), 'engine']). Then you can use {$view_helper->some_method(\$data)} in your view.


View Models

Inside your templates it is possible to render viewModels in your templates by using either of the following methods.

Components

Inside your templates it is possible to render components in your templates by using either of the following methods.

Please note @component is not the same as regular BLADE components. BladeOne does not support these and this is the Perique Frameworks own implementation.

Dependencies

Requires

License

MIT License

http://www.opensource.org/licenses/mit-license.html

Previous Perique Support

Change Log


All versions of bladeone-provider with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
pinkcrab/perique-framework-core Version 1.4.0
eftec/bladeone Version 4.*
eftec/bladeonehtml Version 2.*
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 pinkcrab/bladeone-provider contains the following files

Loading the files please wait ....