Download the PHP package giantpeach/blocks without Composer

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

giantpeach/blocks

Schnapps License

2.0

2.0 introduces an improved Block class to make life simpler. As a result, it is not backwards compatible with blocks created using the 1.0 version of the package.

Updates include:

Using the wp create-block command will now scaffold a block using the 2.0 version of the package, but upgrading existing blocks will require some manual changes. Fortunately, the old Block class is still available under the Giantpeach\Schnapps\Blocks\Compatability namespace, so you don't need to migrate all your blocks at once.

To upgrade an existing block to 2.0 you will need to:

Description

This package aims to simplify block creation and usage in Wordpress. It is designed and included as part of the Peach Schnapps Framework.

It can be used independently, but is designed to work with the other packages in the framework.

Updates and changes to this package are dictated by the projects we work on and their needs, they may not necessarily be backwards compatible.

Installation

composer require giantpeach/blocks

Usage

The package consists of a couple of classes that can be extended to create custom blocks.

The Block class provides a number of methods to simplify block creation and usage and hides away the complexity (block registration, template loading etc) so your extended class can focus on the block's functionality.

The Blocks class handles the actual registration of all your blocks and the traits they use. Typically, you would extend this class in your theme and add your blocks to it.

Quickstart

Once you've extended the Blocks class it registers a WP CLI command to create new blocks. You can use this to create a new block:

wp giantpeach create-block MyBlock [--prose] [--spacing]

This command will scaffold a new block within your theme, including the block controller class, the block json and the twig template.

Optionally you can specify whether the block should use the Prose or Spacing traits.

Traits

The package includes a number of traits that can be used to add functionality to your blocks. These are:

Additional Classes

The package also include a few additional classes that can be helpful to use with your blocks:

License

This package is open source and is licensed under the MIT License.


All versions of blocks with dependencies

PHP Build Version
Package Version
Requires giantpeach/twiglet Version ^1.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 giantpeach/blocks contains the following files

Loading the files please wait ...