Download the PHP package pollora/block-bindings without Composer

On this page you can find all versions of the php package pollora/block-bindings. 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 block-bindings

Pollora Block Bindings: WordPress Block Bindings declared with attributes

Latest version Total downloads Tests

WordPress Block Bindings declared in code: a class with #[BlockBinding] is a source, each method with #[BindingField] is a field a block attribute can be bound to, and the package registers it with WordPress, resolves the value on the page, previews it in the block editor and lists the fields the editor offers. It also ships four sources ready to bind: the post meta, the term meta and the author meta of pollora/meta, and the options a project lists.

Part of Pollora, the Laravel framework for WordPress, where it is installed and wired for you: see Block Bindings. It runs without Laravel too: in a plugin, a Bedrock site or any PHP project.

Installation

Requires PHP 8.3+ and WordPress 6.5+. It builds on pollora/meta, pollora/attributes, pollora/discovery and pollora/hook.

Declaring a source

A field returns a string, an int, a float, a bool, a Stringable (an object with a toHtml() method is written as HTML) or null to keep what the block holds. A method receives the BindingContext (the post, term and block of the context, the arguments of the binding, post(), meta()) and the services its other typed parameters name. A class with __invoke is a single-field source.

Wiring it outside Pollora

The sources are made by a PSR-11 container: give the resolver one that knows them (the dependencies of your own sources, and the shipped ones you register). Then register the shipped sources and let discovery find yours:

$visibility (WordPressContentVisibility) decides whether the visitor may see a post or a term, and $presenter (WordPressValuePresenter) escapes and words a value; both are WordPress adapters of the package. The pollora/option source reads only the options you pass to OptionSource, and the editor learns the fields through BindingEditorData, the ResolveBindingsController (the preview route) and WordPressBindingEditorScript. A method's services are given by ReflectionMethodInvoker (the container's, or a class that needs no argument); give the resolver a MethodInvokerInterface to inject differently.

The Laravel side stays in the framework: the service provider, config/block-bindings.php, pollora:binding:list and pollora:make:binding, the pollora:doctor check, and the injection of method parameters through Laravel's container.

Testing

License

MIT. See LICENSE.


All versions of block-bindings with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
pollora/attributes Version ^0.1.1 || ^1.0
pollora/colt Version ^10.0.1
pollora/discovery Version ^0.1 || ^1.0
pollora/hook Version ^2.0.1
pollora/meta Version ^0.1
psr/container Version ^2.0
psr/log 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 pollora/block-bindings contains the following files

Loading the files please wait ...