Download the PHP package stillat/antlers-components without Composer

On this page you can find all versions of the php package stillat/antlers-components. 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 antlers-components

Antlers Components is a Statamic addon that makes creating isolated, reusable Antlers partials easy and integrating existing Blade and Livewire components a breeze using a familiar syntax.

Installation

You may install Antlers Components using composer:

Requirements

Antlers Components requires at least PHP 8.1 and:

This package provides a familiar syntax for Livewire components, and it is compiled into the Antlers tags provided by this package:

https://statamic.com/addons/jonassiewertsen/livewire

In order to use the Livewire syntax, you will also need to install it using the following command:

For support/reporting issues related to the Livewire functionality beyond compilation errors, please use the following GitHub link:

https://github.com/jonassiewertsen/statamic-livewire

Using Blade Components

You may use Blade Components within your Antlers template using the syntax you are familiar with.

For example, to include a card Blade component we may use the <x-card /> syntax. This package supports Blade component slots; you may use Antlers within the slot:

Using Antlers inside parameter values is acceptable.

Livewire Components

We can integrate existing Livewire components in our Antlers templates using the <livewire /> syntax like so:

Using Antlers inside parameter values is acceptable.

Supported Parameter Types

This package supports the following parameter types when compiling component tags to Antlers:

Shorthand Variables:

Variable References:

Name/Value:

Attribute:

Antlers Components

This package also supports the concept of Antlers "components", which are really just syntax sugar on top of partials (with a few special behaviors).

As an example, we could include a partial named partial-name.antlers.html using this library like so:

Very Important: When using this syntax, the partials will not inherit the scope they were included in (except for the general Cascade). This means that if we want current data to be supplied to our partial, we must explicitly pass it in via. parameters.

The behavior of slots is also slightly different when using this syntax, and is closer to anonymous Blade components.

Let us consider an Antlers partial named _card.antlers.html:

we can render this Antlers partial in our main template like so:

Note: We have to explicitly allow the current article's title and content values by supplying them via. parameters. Without this, it will default to the current page's values.

When using this syntax, we do not need to prefix named slots with slot: inside our partial. Additionally, we also have access to an attributes bag. Parameters supplied to named slots will be available within the partial, as well:

Nesting Antlers Component Partials

We may also nest partial components by including them within other components. Like with regular components, we must specify what values we want to be passed along to our nested components:

We can check if we are inside a nested/child component using the __is_nested variable:

We can also see how deeply nested we are using the __depth variable:

And finally, we may access data from the parent partial if we are nested by referencing the __parent variable:

If that parent has a parent, we can keep on going:

License

This addon is open-sourced software licensed under the MIT license.


All versions of antlers-components with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
stillat/blade-parser Version ^1.2
statamic/cms Version ^4 || ^5
laravel/framework Version ^9.36 || ^10 || ^11
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 stillat/antlers-components contains the following files

Loading the files please wait ....