Download the PHP package trq/gen without Composer

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

Gen

A very very simple static site generator using the Twig template engine.

I developed this very very simple static site generator specifically for generating the http://proemframework.org web site. It is indeed, very very simple.

Installation

The best way to install Gen is via Composer. The following, will create a composer.json file, install all dependencies and bootstrap a skeleton app.

By default Gen expects to find the following structure within the source directory:

An Example

Results in:

Injecting Data

Data (variables, arrays, objects) can be injected into templates at certain levels.

Data is injected by simply creating a .php file that returns the data you want in an array.

Firstly, you can create a global.php file and drop it into the root of the source directory. This data will be available to all templates unless overwritten further down.

Secondly, you can create a local.php file within any sub directory. The data this file provides will be merged with the global.php file above (overwriting any duplicate keys).

Lastly, you can create a .php file with the same name as your .twig file. The data returned by this file will again be merged into the data provided above, and the results will be made available only within the .twig file of the same name.

Twig Extensions

To use a custom Twig extension simply create a class extending the Gen\Twig\ExtensionBase within the Gen namespace and drop it's file into the extensions directory and extend the Gen\Twig\ExtensionBase class.

By extending the Gen\Twig\ExtensionBase your extension will automatically gain access to the current directory being processed, the current file being processed, all options that have been passed into Gen and all data that is currently available.

For information about creating Twig Extensions see http://twig.sensiolabs.org/doc/advanced.html#creating-an-extension

Configuration

All directories and files used by Gen can be easily configured by placing a gen.conf.php file into the root of the source directory and having it return an array of the options you wish to overwrite. By default, this array looks like:

Where $src is either passed into Gen or uses the current working directory as default and $dest is either passed into Gen or uses $src/build by default.

Using the command line helper

Gen comes with a very simple command line utility used to process your site. It has available the following options:

All of these options are optional. If no source directory is provided the current working directory will be used.


All versions of gen with dependencies

PHP Build Version
Package Version
Requires twig/twig Version 1.*
daylerees/kurenai Version 1.*
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 trq/gen contains the following files

Loading the files please wait ....