Download the PHP package fhooe/twig-extensions without Composer

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

fhooe/twig-extensions

A collection of Twig extensions for other fhooe packages used in the Media Technology and Design program at the University of Applied Sciences Upper Austria. It is intended to be used with packages such as fhooe/router or fhooe/router-skeleton respectively.

Installation

Integrate the package into your project using Composer:

Contents

This package contains the following extensions:

RouterExtension

An extension to access the fhooe/router package from within Twig templates. It provides the following functions:

SessionExtension

Provides the function session("someKey"), which returns the value of the given key in the session. That way, not every needed entry in $_SESSION (or even the whole superglobal) must be passed to the template.

Usage

Register the extensions with your Twig environment, then use the provided functions in your templates:

RouterExtension

Register the extension and provide an instance of Fhooe\Router\Router.

Use the functions:

This will output the full path for the route or a base path (if you need to prefix) static paths for stylesheets or other files.

SessionExtension

Register the extension:

Use the function:

This will output the value of $_SESSION["someKey"]. If nothing is stored under that key, sessions are inactive, or the session superglobal is unavailable, an empty string will be returned so that you can use the function safely.

Contributing

If you'd like to contribute, please refer to CONTRIBUTING for details.

License

fhooe/twig-extensions is licensed under the MIT license. See LICENSE for more information.


All versions of twig-extensions with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
fhooe/router Version ^1.0
twig/twig Version ^3.8
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 fhooe/twig-extensions contains the following files

Loading the files please wait ....