Download the PHP package ldf/gutenberg without Composer

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

ldf-gutenberg v0.2.2

Build Status Maintainability Test Coverage

Gutenberg is a view renderer written in PHP and based on the fact that view must be totally separated from logic.

This system will allow you to easily substitute some variables for values and compose views in an easy way for a CMS, but you will not find control structures such as if/ese statements or even template inheritance. If you are looking for this kind of feature, I recommend to have a look at Blade or Twig.

How to install

You can install Gutenberg with composer:

Instantiate Gutenberg

Gutenberg is instantiated by a builder class called :

By using the fluent api, you will be able to set up some extra behaviours. The following lines will build a Gutenberg object with Wipe Out mode enabled:

Template files

Template files are just .html files (as they are expected to contain just html with a couple of Guttemberg tweaks). They must be place in a workspace.

A workspace is essentially a path to a directory.

Templates are referenced by an id which, by convention, resolves to a file in the workspace.

For example, a template identified by will resolve to path and another tempalte identified by will resolve to path

If you decide to an extension other than for your templates, you can specify this as part of your identifier with something like .

Keywords

Gutenberg provides some expressions to allow you to define some dinamic points in your templates.

Generally speaking

Expressions in Gutenberg are anything you place between double curly braces.

If you want to print double curly braces you must use the html entity instead:

Variables

Variables will be refered as {{ varname }}

import

{{ import _partialTemplateId }}

Please, notice that in this case the Id begins with an underscore . This way Gutenberg knows that this template is a partial template. Partial templates, by convention must begin by underscore. Indeed, if they don't begin by underscore they import expression will be ignored.

Also notice that you are already in a workspace, so you can not import templates from another workspace. This way you are forced to avoid cross dependencies.

wrapper

{{ wrapper tplname}}

We don't support inheritance -no, we don't like inheritance. Instead, you are able to wrap templates. Think of wrapping as a sort of reverse-import in which the wrapped template can define one -and only one- template to be wrapped.

When you use wrapping, the source code file must start exactly by the wrapper command.

Wrappers use the {{ content }} mark to define the place were the inner template will be wrapped.

comments

{{- (a.k.a X-Wing operator)

The rest of the line is a comment and will be ingored. For multiple-line comments you can send some X-Wing spaceships:

Now, be a good kid and go add some comments to your code.

Control structures

So, how can I add some structures such as if/else or foreach? The answer is easy: you can't.

Logic should not be on your templates, so you must take care of passing exactly some ready-to-use substitution values.

Extra options

By using the builder, you will be able to configure some extra options

WipeOut

You can enable wipe out feature by calling .

When Wipe out option is enabled any Gutenberg tag which is not recognized, e.g. {{ unknownVariable }}, will be cleaned from the template. An E_USER_WARNING level error will be raised.

Extending Gutenberg's functionality.

Gutenberg provides a feature to add some custom compilers. This will allow you to create your own language expressions. You can add your own language expression calls by implementing ICompiler:

You can add as many custom compilers as you want.

Just take into account that compilers are executed sequentially, begining by the core compilers and the core options. Custom compilers will be executed at the end.


All versions of gutenberg with dependencies

PHP Build Version
Package Version
No informations.
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 ldf/gutenberg contains the following files

Loading the files please wait ....