Download the PHP package kokspflanze/zfc-twig without Composer

On this page you can find all versions of the php package kokspflanze/zfc-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 zfc-twig

ZfcTwig Module for Laminas/Zend Framework Build Status

ZfcTwig is a module that integrates the Twig templating engine with Laminas / Zend Framework.

Information

this is a fork of ZF-Commons/ZfcTwig. I added ZF3 support, so the module works with Laminas / Zend Framework 2 and 3. If you found a bug, please report it, just pm me in gitter or open a PullRequest.

Installation

  1. Add "kokspflanze/zfc-twig": "dev-master" to your composer.json file and run php composer.phar update.
  2. Add ZfcTwig to your config/application.config.php file under the modules key.

Configuration

ZfcTwig has sane defaults out of the box but offers optional configuration via the zfctwig configuration key. For detailed information on all available options see the module config file class.

Documentation

Setting up Twig extensions

Extensions can be registered with Twig by adding the FQCN to the extensions configuration key which is exactly how the ZfcTwig extension is registered.

Configuring Twig loaders

By default, ZfcTwig uses a Twig\Loader\ChainLoader so that loaders can be chained together. A convenient default is setup using a filesystem loader with the path set to module/Application/view which should work out of the box for most instances. If you wish to add additional loaders to the chain you can register them by adding the service manager alias to the loaders configuration key.

Using ZF View Helpers

Using ZF view helpers is supported through the ZfcTwig\Twig\FallbackFunction function.

Examples

Example .twig files for the skeleton application can be found in the examples folder.

Gotchas

ZF does not support multiple renderers with view helpers very well. As a workaround, ZfcTwig registers its own HelperPluginManager that extends the default Laminas\View\HelperPluginManager and adds the default as a peering manager. This let's ZfcTwig register its own renderer with view helpers that require it and fallback to the default manager for view helpers that do not require one.

As a caveat, you must register view helpers that require a renderer with ZfcTwig. An example can be seen in config/module.config.php where the HelperConfig for the default navigation helpers is registered with ZfcTwig.


All versions of zfc-twig with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0
twig/twig Version ^3.3.4
laminas/laminas-mvc Version ^3.0
laminas/laminas-view Version ^2.7
laminas/laminas-servicemanager Version ^3.0
laminas/laminas-mvc-plugin-flashmessenger Version ^1.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 kokspflanze/zfc-twig contains the following files

Loading the files please wait ....