Download the PHP package tobento/app-block without Composer

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

App Block

The app block provides interfaces to create block editors. There are two create your custom editor.

Editing blocks is kept simple having clients in minds. Furthermore, blocks use CSS classes only to style its content. This has multiple advantages:

Table of Contents

Getting Started

Add the latest version of the app block project running this command.

Requirements

Documentation

App

Check out the App Skeleton if you are using the skeleton.

You may also check out the App to learn more about the app in general.

Block Boot

The block boot does the following:

Block Config

The configuration for the block is located in the file at the default App Skeleton config location where you can configure the block editors for your application.

Available Editors

Default Editor

This editor is the default implementation.

Configure Editor

In the Block Config you may configure the existing editor or creating new editors using the .

EditorFactory Methods

You may use the following methods to configure your editor to fit your requirements.

You may check out the App Language to learn more about languages.

Render Editor

In your view file, use the editor method to render the editor with its blocks using views located in the directory.

You may check out the Block Views Editor Middleware section which provides two ways to integrate editors.

Saving Editor

Blocks will be stored using the with a status if not set otherwise. Its up to you changing the status other than .

Mail Editor

This editor will render blocks using views located in the directory.

Configure Mail Editor

In the Configure Editor for its available methods.

Render Mail Editor

Check out the Render Editor section to learn more about it.

Crud Editor Field

You may use the field to easily integrate a block editor when using the App CRUD.

Workflow

Blocks will be stored using the block repository with a status when a CRUD resource has not been saved. Once the CRUD resource is saved, the status will be changed to . When a CRUD resource gets deleted, the status will be changed back to . In addition, blocks will be stored in JSON format in the specified CRUD BlockEditor field.

To clean blocks consider using the Purge Blocks Command.

Render Blocks

There are many ways how to render the stored blocks. One way is to use the editors block factory to render the created blocks stored in your CRUD resource.

Block Views Editor Middleware

The block views editor middleware integrates block editors based on the defined block views and the specified or resolved resource.

Set up

You may configure the resource resolver in the Block Config file:

View

Views starting with are specific to its defined resource , meaning blocks will only be rendered on the matching resource. Views such as and will always render its blocks within the same but indepedently of the . You can define as many views you like.

Deleting Blocks

If your resource is a App CRUD being resolved by the slugs, you may use field, which will delete blocks while deleting the field.

Otherwise, you will need to implement your own logic using the block repository.

Available Blocks

Downloads Block

This block lets you add files to be displayed for download or be viewed in browser.

Requirements

Make sure you have the storage added on the parameter on each of the following features in the file:

You may check out the App Media for more information.

Hero Block

This block creates an editable text block using the Js Editor and lets you add an image to be displayed.

Image Block

This block lets you add an image to be displayed.

Image Gallery Block

This block lets you add multiple images to be displayed as a gallery. Clicking on an image opens up a modal with bigger sized images.

Persons Block

This block lets you add persons to be displayed. For instance, you add a team section.

Text Block

This block creates an editable text block using the Js Editor.

Block Options

You can configure the block options in the file in the interfaces section:

You may customize editable block options for each block separately:

Available Methods:

Available Block Options

Classes Option

The classes option lets you select multiple CSS classes to be assigned on the block.

Color Option

The color option lets you select a color for the background and text.

Layout Option

The layout option lets you define multiple layouts for the block if supported.

Make sure, you have created the corresponding view file like and , otherwise the default view file is used.

Margin And Padding Option

The margin and padding option lets you select a margin and/or padding size.

Deleting Generated Pictures

Blocks such as the Media Picture Feature.

To clear generated pictures, once a block is updated or deleted, you will need to define an event listener in the file:

Console

Purge Blocks Command

Use the following command to purge blocks:

If you would like to automate this process, consider installing the App Schedule bundle and using a command task:

Learn More

Creating Custom Editor

Option 1 with view namespace only

In the Block Config file just add a custom .

Finally, add the view files in the defined which you want to customize skipping others you do not want to customize.

Option 2 with custom editor factory

By creating a custom editor factory, you will be able to add blocks using the factory.

First, create the editor factory by extending the :

Next, add the view files in the defined which you want to customize skipping others you do not want to customize.

Finally, configure your editor in the Block Config file.

Adding Blocks Using Editor Factories

It may be useful to add blocks using the editor factories from within the app if you have different components such as a Shop component providing specific shop blocks.

Credits


All versions of app-block with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
tobento/app Version ^1.0.7
tobento/app-console Version ^1.0
tobento/app-crud Version ^1.0
tobento/app-http Version ^1.0
tobento/app-migration Version ^1.0
tobento/app-view Version ^1.0
tobento/app-user 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 tobento/app-block contains the following files

Loading the files please wait ....