Download the PHP package rareloop/primer-template-engine-twig without Composer

On this page you can find all versions of the php package rareloop/primer-template-engine-twig. 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 primer-template-engine-twig

Twig Template Engine for Primer

CI

A template engine for Primer that uses Twig rather than the deafult (Handlebars).

Installation

  1. In the composer.json in your Primer install, replace:

    `

    with:

    `

  2. Run composer update.

  3. Modify your bootstrap/start.php file and change the Primer::start call to include the templateClass e.g.

    ``

  4. Replace all .hbs files in your patterns and views with `.twig' files. If you don't want to do this by hand you can download the base Primer files in Twig format from this repo.

Usage

Including patterns within one another

Any pattern can be included within another by using the standard include syntax, e.g.

`

More information on using {% include %} and manipulating the passed in context can be found on the Twig website.

Extending Templates

By default, Primer will wrap all page Templates with a common View (views/template.twig). When using {% extends %} this wrapping is sometimes undesirable, in such circumstances you can disable this behaviour in a couple of ways.

  1. On a per page Template basis. Add the following to the Templates data.json file:

  2. Site wide. Add wrapTemplate: false to the Primer::start call in bootstrap/start.php, e.g.

Twig Template Cache

By default Primer uses a directory called cache inside the project root for cache files. To change this to somewhere else you can set an alternative when you start Primer in bootstrap/start.php, e.g.

``

Custom Events

Most of the Primer events are still available, this package adds a few engine specific events too:


All versions of primer-template-engine-twig with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
twig/twig Version ^2.0.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 rareloop/primer-template-engine-twig contains the following files

Loading the files please wait ....