Download the PHP package asgardcms/block without Composer

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

Block Module

Latest Version Quality Sblock SensioLabs Insight CodeClimate Total Downloads Slack

Branch Travis-ci
master Build Status
2.0 Build Status

Installation

Download

You can install the Block module, with the following command which allows the module to be edited for your project.

Composer

You can install the Block module with composer:

Then run the following command to install the database tables:

Permissions

In the backend GUI, go to Users > Roles > Admin. Then the permissions tab, and give the Admin role the permissions for the block module.

Documentation

This is a very simple module to create re-usable blocks of content. The blocks of content are created in the administration. You give it a name and a content.

After this, you'll be able to get the content of a block with the following code:

Each block also receives a shortcode that can be used instead of the code mentioned above. Shortcode looks like this [[BLOCK(block-name)]].
This is very useful if you for example want to allow users to reuse and enter blocks into content of the WYSIWYG editor (page or blog article body)

If you want to use shortcodes in your app, you need to register RenderBlock middleware responsible for parsing the response and replacing the shortcodes with the actual block content. It can be done globally by editing app/Http/Kernel.php file and adding \Modules\Block\Http\Middleware\RenderBlock::class into the $middlewareGroups web group (this way, block shortcodes will be automatically replaced in all web routes on frontend):

There are some drawbacks to this approach, specifically that each response will be parsed and searched for the shortcodes before returning back to the user, which may slightly slow down your application. If you know that you do not need to use shortcodes in the whole app, middleware can be applied selectively only to some routes or route groups in your application:

Keep in mind that by allowing users to put blocks/shortcodes anywhere, you are creating a potential security issue, so use this functionality carefully.

Hooks

Hooks are special events, where it allows you to change the data stored before it's stored in the database.

BlockIsCreating

Triggered before a block is created.

BlockIsUpdating

Triggered before a block is updated.

BlockContentIsRendering

Triggered when a block body gets displayed.

Resources

Info

All AsgardCMS modules respect Semantic Versioning.


All versions of block with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.4
composer/installers Version ~1.0
idavoll/core-module 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 asgardcms/block contains the following files

Loading the files please wait ....