Download the PHP package gencer/twigbridge-laravel-4 without Composer

On this page you can find all versions of the php package gencer/twigbridge-laravel-4. 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 twigbridge-laravel-4

Allows you to use Twig seamlessly in Laravel 4.

Latest Stable Version Total Downloads Build Status Coverage Status License

NOTE: This is a fork of current TwigBridge by Robert Crowe. I maintained this because the current beta stage forces us to use dev branch of all repos. I do not want to use dev branch for all components, personally :)

Installation

Add gencer/twigbridge-laravel-4 as a requirement to composer.json:

Update your packages with composer update or install with composer install.

Once Composer has installed or updated your packages you need to register TwigBridge with Laravel itself. Open up app/config/app.php and find the providers key towards the bottom and add:

You can add the TwigBridge Facade, to have easier access to the TwigBridge (or Twig_Environment).

Configuration

TwigBridge's configuration file can be extended by creating app/config/packages/rcrowe/twigbridge/config.php. You can find the default configuration file at vendor/rcrowe/twigbridge/src/config/config.php.

You can quickly publish a configuration file by running the following Artisan command.

Usage

You call the Twig template like you would any other view:

TwigBridge also supports views in other packages:

The above rules continue when extending another Twig template:

You can call functions with parameters:

And output variables, escaped by default. Use the raw filter to skip escaping.

Extensions

Sometimes you want to extend / add new functions for use in Twig templates. Add to the enabled array in config/extensions.php a list of extensions for Twig to load.

TwigBridge supports both a string or a closure as a callback, so for example you might implement the Assetic Twig extension as follows:

TwigBridge comes with the following extensions enabled by default:

To enable '0.5.x' style Facades, enable the Legacy Facades extension:

FilterLoader and FunctionLoader

These loader extensions exposes Laravel helpers as both Twig functions and filters.

Check out the config/extensions.php file to see a list of defined function / filters. You can also add your own.

FacadeLoader

The FacadeLoader extension allows you to call any facade you have configured in config/extensions.php. This gives your Twig templates integration with any Laravel class as well as any other classes you alias.

To use the Laravel integration (or indeed any aliased class and method), just add your facades to the config and call them like URL.to(link) (instead of URL::to($link))

Functions/Filters/Variables

The following helpers/filters are added by the default Extensions. They are based on the helpers and/or facades, so should be self explaining.

Functions:

Filters:

Global variables:

Artisan Commands

TwigBridge offers a command for CLI Interaction.

Empty the Twig cache:

Lint all Twig templates:


All versions of twigbridge-laravel-4 with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
twig/twig Version ~1.15
illuminate/support Version ~4.0
illuminate/view Version ~4.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 gencer/twigbridge-laravel-4 contains the following files

Loading the files please wait ....