Download the PHP package edalzell/blade-directives without Composer

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

Blade Directives

This package provides custom directives so you can easily access Statamic data in your Blade templates.

ARCHIVED

Note that with the release of Statamic 3.3, this addon is no longer needed. Please update to 3.3 and use the native Statamic::tag(...) functionality. If you need any changes, please fork.

Requirements

Installation

You can install this package via composer using:

The package will automatically register itself.

Usage

Automatic augmentation of Statamic values

If you want values to be augmented automatically in your Blade views, you can replace the

Illuminate\View\ViewServiceProvider::class in the providers of your config/app.php with \Edalzell\Blade\Augmentation\AugmentationViewServiceProvider

This will replace all instances of \Statamic\Fields\Value by their augmented values.

Antlers

If tag(), modify() or any of the below directives aren't achieving the desired outcome, it is possible to try the Antlers directive to render Antlers within Blade.

We do this by using the Antlers Facade and its parse method.

There are some things to note however, for these examples we will describe $str as the content or string that you wish to have Antlers parse into Html, while $variables is the context or data that will be passed to Antlers and is used to map variables and data to Antlers, The context will automatically be added to the Antlers::parse call, however if you define the second parameter $variables then the default context will be ignored and your supplied context will act as an override.

An example of this would be if we passed $str into our view,

But now if we instead remove the single quotes from foo, then we will need to provide the context of what foo is.

It is also possible to use the directive inline. If passing everything inline, then the Antlers content will need to have @ added to its curly braces. quotes will need to be escaped too.

You can also use @php blocks to define the content and or context.

This directive can be used in a bunch of different ways, let your imagination run wild! All you need to do is provide the content and then any context that it might need, how you get/set or provide those doesn't really matter that much.

The default context can be obtained with the following code collect(get_defined_vars())->except('__data', '__path')->toArray()

Assets

Breadcrumbs

You can use the same parameters as the nav:breadcrumbs tag.

Collection

Use the same params as the {{ collection }} tag

Collection Pagination

Data

Use this when you have Statamic data but it's a Value object. This will return a keyed array with all the fields as string/ints/arrays (recursively).

Entry

Gets all the data in an entry. In the example below the data is a replicator, so you have to walk through the sets.

Forms

You can pass in the same parameters that {{ form:create }} supports. Any other parameters will be added to the <form> tag as attributes.

To access the errors, use standard Blade errors but pass in the proper error bag, which is form.your-form-handle.

Form Fields

Loops over the fields for a form.

Glide

Generates the glide image.

Globals

Nav

You can use the same parameters as the nav tag.

Site

Taxonomy

Use the same params as the {{ taxonomy }} tag

Testing

Run the tests with:

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.


All versions of blade-directives with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
laravel/framework Version ^7.30.3 || ^8.24 || ^9.0
statamic/cms Version ^3.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 edalzell/blade-directives contains the following files

Loading the files please wait ....