Download the PHP package ongr/router-bundle without Composer

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

ONGR Router Bundle

Router Bundle allows to define and match URLs for elasticsearch documents. At url matching phase it additionaly searches for elasticsearch documents with specified url.

This can be used for generating/matching nice URLs for any document. Beautiful URLs help SEO and improve user's usability experience.

If you have any questions, don't hesitate to ask them on Join the chat at https://gitter.im/ongr-io/support chat, or just come to say Hi ;).

Build Status Coverage Status Latest Stable Version Scrutinizer Code Quality

Documentation

The online documentation of the bundle is here

For contribution rules take a look at contribute topic.

Setup the bundle

This bundle strongly uses ONGR Elasticsearch Bundle. We assume that you are familiar with it and it already suits your needs.

Step 1: Install Router bundle

Router bundle is installed using Composer.

Enable Router and Elasticsearch bundles in your AppKernel:

Yep, that's it, 1 step installation. All the next steps are demonstration how to setup product document with SEO URLs. So look below how easy it is and adapt it for your needs.

Step 2: Add configuration

Add minimal configuration for Router and Elasticsearch bundles.

WARNING: If SeoAwareTrait is used you must implement urlAnalyzer analyzer, otherwise there will be a fatal error on index create.

In the configuration of the bundle you need to specify the es.manager to use and under the seo_routes you have to specify documents that will have seo_routes as keys and the controller action that will handle the request as a values.

urlAnalyzer at ongr_elasticsearch configuration defines how all url fields are analyzed by Elasticsearch.

If you are using another third party bundle that also has an aliased Symfony router, you may set disable_alias to true. This prevents possible conflicts.

router_priority parameter defines the priority with which the ONGR dynamic router is set to the chain router. It defaults to -100 in order to be called after the standard Symfony router but this value can be changed depending on your projects' need.

Check Elasticsearch bundle mappings docs for more information about the configuration.

Usage example

Step 1: Create a Product document

Lets create a Product document class. We assume that we have an AppBundle installed.

In favor to support friendly URLs, the bundle provides SeoAwareTrait with predefined mapping.

Step 2: Create controller and action for the product page

Step 3: Create index and insert demo product

Create an elasticsearch index by running this command in your terminal:

More info about all commands can be found in the Elasticsearch bundle commands chapter.

Also, run the following curl command in your terminal to insert a product for this demonstration.

Step 4: Check if it works

Just visit /music/electric-guitar page and you should see a title of the product that you inserted in step 3.

License

This bundle is under the MIT license. Please, see the complete license in the bundle LICENSE file.


All versions of router-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
symfony/symfony Version ~2.8|~3.0
symfony-cmf/routing Version ^1.4.0
ongr/elasticsearch-bundle Version ^5.0.0
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 ongr/router-bundle contains the following files

Loading the files please wait ....