Download the PHP package axis/axis-curly-routing-plugin without Composer

On this page you can find all versions of the php package axis/axis-curly-routing-plugin. 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 axis-curly-routing-plugin

AxisCurlyRouting

This plugin introduces to symfony 1.x a new route class that uses curly braces in pattern just like Symfony2 routes.

Installation

Use Composer. Just add this dependency to your composer.json:

Usage

Now you can use Curly routes. Just declare routes in your routing.yml files with CurlyRoute class specified:

That's all. You can reference this route as you usually do with any symfony route.

For generating URLs:

For routing requests to controller:

Sugar

Yeah. There is some new cool things you can do with this routes.

Hierarchical URLs

One of the main reasons of implementing this routes was the ability to use path variables in routes. For example you want to use something like hierarchical structure in your urls:

You could do this with default symfony routing:

This works well routing requests from /my/assets/path/image.png to defined controller. But when you need to generate url for that path you'll get this: /my%2Fassets%2Fpath/image.png.

Curly routes enable you to use them for this kind of tasks.

Variables delimited by any symbols

Propel Object route on steroids

You can handle propel object requests using CurlyObjectRoute just like you did it with sfPropelRoute.

And you can use this like you did with sfPropelRoute. For generating URLs:

and for retrieving object from controller:

Namespaces

Sometimes you need to use object properties plus some other variables in your URLs. Now you can use CurlyObjectRoute to handle this just defining namespace:

And usage. For generating URLs:

and for retrieving object from controller:

Multiple objects per route

Also you can use more than one object in your routes.

And usage. For generating URLs:

and for retrieving object from controller:


Note: To use CurlyObjectRoute you should upgrade your project to use Propel 1.6 by installing PropelORMPlugin.

Extending Curly Routes

You can use any custom parameters converters with CurlyRoutes. Define them using transform option:

To implement custom parameter transformer in your project create a class that implements \Axis\S1\CurlyRouting\Transformer\DataTransformerInterface.

This transformer takes an array of parameters on input and returns a resulting array of parameters to be used by route.

The result of transformForUrl method will be used when you generate an URL:

On the other hand by navigating to that url (/say/foohellobar) the route will fetch weird_word variable with the value set to foohellobar. Than it will be passed through all your route's defined data transformers and you'll get the transformed variables in your request and controller:

You can do a lot of cool stuff using custom transformers without the need to implement custom routes. By the way, CurlyObjectRoute uses transformers to handle object requests. Look at that class to find more about params transformers. You can chain them and reuse already implemented code.

Sounds fantastic isn't it?


All versions of axis-curly-routing-plugin with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
composer/installers Version *
symfony/routing Version 2.2.*
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 axis/axis-curly-routing-plugin contains the following files

Loading the files please wait ....