Download the PHP package noxlogic/multiparam-bundle without Composer

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

NoxLogicMultiParamBundle

This bundle provides enables the @MultiParamConverter. It's similar to the @paramConvert annotation, except for the following additional features:

Installation

Installation takes just few easy steps:

Step 1: Add the bundle to your composer.json

If you're not yet familiar with Composer see http://getcomposer.org. Add the MultiParamBundle in your composer.json:

Warning:

if you use Symfony 2.0 the require value should be 2.0.*

Now tell composer to download the bundle by running the command:

Step 2: Enable the bundle

Enable the bundle in the kernel:

Step 3: Add use statements for the MultiParamBundle

In any controller that makes use of the MultiParamConverter add this use statement:

That's it. You should now be ready to implement the converter based on the examples below. Of course you do need to have some entities to make it work.

Features

Multiple converters

The main function for this converter is to enable multiple converters per action. Where the standard @paramConvert only allows one variable to be converted, this converter can do multiple:

/**
 * @route("/acme/category/{category_id}/article/{article_id}")
 *
 * @multiParamConverter("category", class="AcmeBundle:Category")
 * @multiParamConverter("article", class="AcmeBundle:Article")
 */
public function showAction(Category $category, Article $article) { ... }

Customize slug name

Because there are multiple converters possible, using just "id" as your slug will not work. The multiParamConverter will find the variable name and checks for a slug named "_id". If that slug isn't available, it will default to the "id" slug.

If you need another name, you can supply this in the options:

/**
 * @route("/acme/country/{iso3}/airport/{iatacode}")
 *
 * @multiParamConverter("airport", class="AcmeBundle:Airport", options={"id = "iatacode"})
 * @multiParamConverter("country", class="AcmeBundle:Country", options={"id = "iso3"})
 */
public function showAction(Country $country, Airport $airport) { ... }

Customize entity fetch method

It's possible to fetch an entity from something else than the primary key. When no additional options are given, this is the default behaviour, but finding entities on other properties is also possible:

/**
 * @route("/acme/country/{iso3}/airport/{iatacode}")
 *
 * @multiParamConverter("airport", class="AcmeBundle:Airport", options={"id = "iatacode", "method" = "findOneByIataCode"})
 * @multiParamConverter("country", class="AcmeBundle:Country", options={"id = "iso3", "method" = "findOneByIso3Code"})
 */
public function showAction(Country $country, Airport $airport) { ... }

Customize entity manager

If you have multiple entity managers and you want to use a non-default entitymanager, you can supply the 'entity_manager' option in order to change which manager is used.

/**
 * @route("/acme/{post_id}")
 * @multiParamConverter("post", class="AcmeBundle:Post", options = {"entity_manager" = "foo"})
 */
public function showAction(Post $post) {

As with the default paramConverter, if you use typehinting AND you only need to use the default options, you can omit the @MultiParamConverter annotation alltogether. Both examples are identical:

/**
 * @route("/acme/{post_id}")
 * @multiParamConverter("post", class="AcmeBundle:Post")
 */
public function showAction(Post $post) {

/**
 * @route("/acme/{post_id}")
 */
public function showAction(Post $post) {

More info

Read more about this converter on its official homepage, and do not hesitate to contact me for issues and/or bug(fixes). PR's are always welcome!

Special thanks to CruiseTravel, for whom this converter was originally written and allowed to open-source the code.


All versions of multiparam-bundle with dependencies

PHP Build Version
Package Version
Requires sensio/framework-extra-bundle Version 2.1.x-dev
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 noxlogic/multiparam-bundle contains the following files

Loading the files please wait ....