Download the PHP package leitsch/kirby-blade without Composer

On this page you can find all versions of the php package leitsch/kirby-blade. 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 kirby-blade

Kirby Blade

Source Download Open Issues Last Commit Release License

Kirby Blade use Laravel illuminate/view 11.x package and compatible with Kirby 4.

This package enables Laravel Blade for your own Kirby applications.

Installation

Caveat: Laravel and Kirby both define the e() helper function, but they do vastly different things. In Kirby, e() is basically just a shortcut for echo $condition ? $a : $b;. In Laravel, this function escapes HTML characters in a string. From Kirby 3.7 and up, you have to disable Kirby’s own e() helper by adding a single line of code to your index.php, before including the autoload.php file:

What is Blade?

According to Laravel Blade documentation is:

Blade is the simple, yet powerful templating engine that is included with Laravel. Unlike some PHP templating engines, Blade does not restrict you from using plain PHP code in your templates. In fact, all Blade templates are compiled into plain PHP code and cached until they are modified, meaning Blade adds essentially zero overhead to your application. Blade template files use the .blade.php file extension.

Usage

You can use the power of Blade like Layouts, Forms, Sub-Views, Components, Directives and your custom if statements.

All the documentation about Laravel Blade is in the official documentation.

Options

The default values of the package are:

Option Default Values Description
leitsch.blade.templates site/templates (string) Location of the templates
leitsch.blade.views site/cache/views (string) Location of the views cached
leitsch.blade.directives [] (array) Array with the custom directives
leitsch.blade.ifs [] (array) Array with the custom if statements

All the values can be updated in the config.php file.

Templates

Default templates folder is site/templates directory or wherever you define your templates directory, but you can change this easily:

Views

All the views generated are stored in site/cache/views directory or wherever you define your cache directory, but you can change this easily:

Directives

By default, Kirby Blade comes with following directives:

But you can create your own:

Kirby Helpers Documentation:

https://getkirby.com/docs/reference/templates/helpers

If Statements

Like directives, you can create your own if statements:

After declaration, you can use it like:

Anonymous components

To define an anonymous component, you only need to place a Blade template within your site/templates/components directory. To render an alert component you have to define site/templates/components/alert.blade.php and the component can be rendered like:

More about anonymous components in the official Laravel Blade documentation.

Class based components

For class based components, the app namespace must be added to your project composer.json.

The class must be placed in the site/components directory and will be autoloaded by the package.

A button class could look like:

The blade file of the button class should be placed in the site/templates/components/button.blade.php directory.

Hook

For use cases such as HTML minification, there's a custom hook for manipulating rendered HTML output:

Credits


All versions of kirby-blade with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
getkirby/composer-installer Version ^1.2
getkirby/cms Version ^4.0
illuminate/config Version ^11.0
illuminate/view Version ^11.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 leitsch/kirby-blade contains the following files

Loading the files please wait ....