Download the PHP package piotrpolak/conditional-routing-bundle without Composer

On this page you can find all versions of the php package piotrpolak/conditional-routing-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 conditional-routing-bundle

Symfony conditional-routing-bundle

Build Status Code Climate Test Coverage SensioLabsInsight

Provides a way to load selected Symfony bundle routes based on a set of user defined conditions.

Solves the problem of redirecting (overwriting) Symfony application routes from a base bundle to another bundle.

Example usages

Installation

Install composer package

Enable PiotrPolakConditionalRoutingBundle in the application kernel

Include bundle routing

Including routing.yml will enable the ConditionalRouterLoader.

Symfony will only load the resource loader if you use it for at least one route. You can alternatively paste the contents of the above resource file directly in your app/config/routing.yml.

Implement your own route resolver

Route resolvers are the components that implement RouteResolverInterface and decide which bundles' routing is to be included at the request time.

A typical route resolver component is registered in the container configuration under the conditional_loader.route_resolver tag - you can register any number of route resolver components and all of them will be taken in account when selecting the combination of bundles to be included.

Since you can pass any other component to the route resolver constructor (like @session, @security.token_storage...) bundles can be picked using any user defined scenarios.

Example - date condition

The following example loads MyCampaign2016Bundle routing based on the year condition. Note: MyCampaign2016Bundle must first be enabled in AppKernel.php.

Please note that AbstractYamlRouteResolver is just a helper that makes use of RouteResolverInterface easier.

Example - database value input

Reading the current bundle name from the database.

Example - loading routing of various types

Route resolver from the following example implements directly the RouteResolverInterface and loads routing of both YAML and XML types.

Compatibility

Precautions

If you are trying to generate a link to a route that is not currently active, Symfony will throw an error. To avoid situations like that please make sure all routes have their default behavior defined in one of you base bundles.

Development

Code should be checked using phpmd before being commited:

Testing

To test in an arbitrary version combination, please use (sudo might be required to connect to the Docker daemon):

Known issues

Warming up the Symfony cache will nor remove the custom router matchers and generators as we are not able to predict the final combination of the router-enabled bundles (they are only known at the runtime).

A workaround to clean up the cache would be to add the following commands to your deploy scripts:


All versions of conditional-routing-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
symfony/yaml Version ~2.3|~3.4
symfony/routing Version ~2.3|~3.4
symfony/dependency-injection Version ~2.3|~3.4
symfony/config Version ~2.3|~3.4
symfony/http-kernel Version ~2.3|~3.4
symfony/framework-bundle Version ~2.3|~3.4
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 piotrpolak/conditional-routing-bundle contains the following files

Loading the files please wait ....