Download the PHP package cscfa/twig_ui_bundle without Composer

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

TwigUIBundle

Version: 1.0.0

The TwigUIBundle is a symfony2 bundle that provide process to use modules.

Installation

Register the bundle into app/appKernel.php

Create a module

The TwigUIBundle allow to create modules to process an twig rendering as hierarchic modules.

Two modules types exists :

The TopLevelModules represents the modules that are directly injected into the module set of a controller. To create a TopLevelModule, you must create a class that extends AbstractTopLevelModule. This abstract class implements the base methods and process to inject the template and arguments to render into the module environment.

The StepModule represents the childs modules of a TopLevelModule. It work as the TopLevelModule but you must extends the AbstractStepModules.

You must define the 'getName()' and 'render(EnvironmentContainer $environment)' methods. The 'getName' method must return an unique as possible string to be used as template's calling definition alias. The 'render' method is the method where you can write you'r php logic.

The 'render' method is allowed to return 'null' or an instance of 'TwigRequest'. Returning null indicate that the module not create any twig view.

The 'EnvironmentContainer' instance passed to 'render' method allow to access to the informations given by the controller.

Create a twig request

The 'TwigRequest' class allow to store informations to render a twig template behind the usage of EnvironmentContainer.

A 'TwigRequest' instance store a template name and the calling arguments.

The 'TwigRequest' class allow to store childs but this is currently managed by the hierarchization of the modules.

Register you'r module

The modules are registered as tagged services.

The tags that needs to be defined are:

The value of the 'name' tag can be customize into the TwigUIBundle configuration.

The tag that target the parent can be customize into the TwigUIBundle configuration.

The tag that define the method to call can be customize into the TwigUIBundle configuration.

Here an exemple of TwigUIBundle configuration :

The services are stored by default into an instance of ModuleSet that process the contained modules in order of they priority. The priority can be define into the service definition. The priority is stored as float value.

Here an example of module definition present into the unit tests:

Use modules into you'r controller

In the last example, you can see that the first service is an instance of ModuleSet. It's the service that the controller will call to process the modules, so you must create a service that instanciate ModuleSet.

To create a controller that process modules, you must extends the 'ModulableController'. This class provide access to the 'processModule' method.

In the following example, the controller return directly the twig result of the the first argument template. The second argument define the current method and the third indicate the main ResultSet service that contain the modules.

The 'processModule' method take a fourth optional 'EnvironmentOptionBuilder' argument. It allow to give optional parameters to the Environment.

The followed exemple make the current accessible from the modules :

The 'EnvironmentOptionBuilder' allow to register options withe the following types :

type argument format
OBJECT_CONTAINER_OBJECT array($object, "alias")
CONTROLLER_INFO_CONTROLLER "controller name"
CONTROLLER_INFO_METHOD "controller method"
TWIG_REQUEST_TWIG_REQUEST array($twigRequest, "alias")

Create a module template

The template that display the result of the controller must call the 'twigUIEnvironment' function. The module environment is directly passed as 'environment' variable.

The step templates receive the arguments as defined into the TwigRequest and the additionals 'moduleName' and 'moduleChilds' variable. They must call the 'twigUIModule' function to render the childs modules.


All versions of twig_ui_bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.9
symfony/framework-bundle Version ~2.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 cscfa/twig_ui_bundle contains the following files

Loading the files please wait ....