Download the PHP package braunstetter/localized-routes without Composer

On this page you can find all versions of the php package braunstetter/localized-routes. 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 localized-routes

LocalizedRoutesBundle

Scrutinizer Code Quality Code Coverage Build Status Total Downloads License

This bundle simply redirects your requests to a locale prefixed route.

So /news is going to be /en/news, if the current language is en.

Localized routes are something that has been repeatedly discussed on sites like StackOverflow in the past.

I think it's better to use a well tested bundle for this purpose instead of writing a new listener for each project. This bundle can then be further developed and improved by the community.

Installation

composer require braunstetter/localized-routes

Now you can prefix your controller routes:

You're done! Your blank routes are getting redirected to localized ones.

Configuration

Since the framework bundle already provides two configuration values (default_locale, enabled_locales), we can use this to configure our forwarding process.

default_locale

This is just the fallback locale. If not set, Symfony will try to determine a value based on your system settings. Most likely 'en'.

enabled_locales

If this value is not specified, then all locales are allowed. If you transfer an array of values here, the selection is restricted accordingly.

Parameters

This bundle exposes the enabled_locales and default_locale configuration values of the framework-bundle as parameters. In addition to this, you also have an enabled_locales_string parameter - joining your enabled_locales e.g.: de|en|es

So you can use these locale-specific parameters in your configuration files:

This bundle can certainly be improved. If you have any questions and/or suggestions for improvements, don't hesitate to create a new issue or submit a PR.

Todo


All versions of localized-routes with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
symfony/framework-bundle Version ^4.4|^5.0|^6.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 braunstetter/localized-routes contains the following files

Loading the files please wait ....