Download the PHP package makinacorpus/php-layout without Composer

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

PHP basic layout API

Build Status

Object representation of a display layout, based upon CSS basic functionnality:

Once you understood this basic principle, you can use the API.

Leaf items (non container) are represented by an interface, with very few methods to implement, and a handler service, whose basic features are:

You probably understood it now, this was tailored for rendering speed on more complex frameworks that are already able to provide support for preloading and pre-rendering objects (for example, Drupal).

Please note this is, as of today, rather a playground than an API you could use, but it worth the short of trying.

Before going deeper

You should be aware the goal of this API is to, in a near future, be integrated into page composition tools, and its API to be hidden behind user friendly UI for contributing. Don't be afraid of the concrete code example below, it only shows how it works, but won't be revelant for concrete use cases of this API.

Complete example

For the sake of simplicity, we are going to use the unit test example to explain the layout we want to display, here is an HTML reprensentation of what the bootstrap grid we want:

Which, for the sake of comprehensibility, would display as such (yes I am sorry this is basic copy/paste of the comment lying in the unit test):

Creating a layout

And the associated PHP code for creating the container tree:

Render the layout

Before initializing the type handlers, we will first create the containers type handlers: containers are the basis of the grid and are responsible for the vertical and horizontal layout management.

Now that we have our top-level container, we need to instanciate the various type handlers:

Then render it:

Which should give you for the $string the HTML representation we did show before.

Why should it render fast?

When you ask for rendering, two very important things are done:

Because containers do not represent anything related to the database or any business object either, you don't have anything to preload nor very complex in their rendering: they are rendered in the end in their inter-dependency order.


All versions of php-layout with dependencies

PHP Build Version
Package Version
Requires php Version >=7.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 makinacorpus/php-layout contains the following files

Loading the files please wait ....