Download the PHP package giantpeach/schnapps without Composer

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

Peach Schnapps

Schnapps

What is Peach Schnapps

Peach Schnapps is our Wordpress site boilerplate based on the roots.io stack, making use of Bedrock for the site structure and the new WP Block Theme functionality for the theme.

Stack

Pre-requisites

Modules

Peach Schnapps comprises of several different modules, designed to be updated separately to ease future development and support on projects.

These modules are:

Theme Folder Structure

Blocks

Blocks in Peach Schnapps are handled by the giantpeach/blocks library. This library contains some simple wrappers around block creation / registration / rendering to make life easier, and it allows a mixture of ACF Blocks and those using Wordpress Block API directly.

The following blocks are included:

Creating Blocks

Easy Way

There is a create-block WP CLI command you can run using lando wp create-block <blockname> to scaffold a block.

Manual Way

Additional blocks can easily be created using either ACF Blocks or the Wordpress Block API. The simplest way is to use ACF Blocks, and there's a BlockInterface PHP class interface and several examples to help out (e.g. the Banner block).

For any block where you require more control over the markup in the editor you may want to reach for the Wordpress Block API. Blocks created in either way are fully compatible with each other.

All blocks need to be added to the $blocks variable in the Giantpeach\Schnapps\Blocks class in order to be registered.

Creating an ACF Block

Additional ACF Blocks can easily be created by creating a new folder within the src/blocks folder with a block.json and the PHP class at a minimum.

The block.json should contain the following:

The PHP class needs to implement the BlockInterface, here is a minimal example:

You will then be able to head to ACF > Field Groups and attach any fields you like to the block.

Creating a Wordpress Block

Creating a Wordpress Block is a little more involved and will require you to become familiar with the Wordpress Block API, as well as requiring an additional build step.

These Blocks are harder to reuse outside of the Wordpress Block editor.

Blocks Class

The Giantpeach\Schnapps\Theme\Blocks\Blocks class is where all block and pattern registration is handled. Add your blocks to the $blocks array and they will be registered and useable within the site.

Patterns currently require manual initialisation in the registerPatterns method. You can see an example in the Giantpeach\Schnapps\Theme\Patterns\TitleLinkColumn class.

Block Class

The Giantpeach\Schnapps\Blocks\Block class handles block registration, rendering the twig template and provides some classes to handle font size and block spacing. Each block you create using the create-block command will be set up to inherit from this class but you can always create a specific class that inherits it if the project has certain requirements that aren't covered by the defaults.

Class Properties

$blockName - e.g. 'giantpeach/block'

$isAdmin - true if in the block editor, false if viewing block on the front end. Useful if you need to apply specific styling in the admin

$blockSpacing - an array of different padding for use on the block

$classes - an array of classes for use in the template, e.g. {{ classes.block.spacing }}

Class Methods

getClasses() - constructs the $classes array

render() - renders the view.twig template if found, otherwise renders the template.php template instead

getBlockName() - returns the block name

registerBlock() - loads and registers the block.json

display() - used to create and render the block in the block editor

getBlockNameFromDir()

Patterns

Patterns are collections of blocks that you can drop into the page. You click the pattern and the blocks that make up the pattern are inserted into the page, ready for you to edit.

It’s also possible to create a new pattern, either in code or via the admin interface (which will be saved within the DB).

Wordpress Block editor

Wodpress uses JS & React to create components in CMS. You can use src/Editor/editor.js file to make changes.

To compile editor script use npm run dev-editor command. It will output the files to /dist/editor. These files are connected with CMS in Schnapps.php blockEditorScripts function


All versions of schnapps with dependencies

PHP Build Version
Package Version
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/schnapps contains the following files

Loading the files please wait ....