--- title: Installing AltoRouter layout: default ---

Using AltoRouter Installation

Install AltoRouter using Composer

To install using Composer, you will have to install Composer first.

{% highlight bash %} curl -s https://getcomposer.org/installer | php {% endhighlight %}

Create a composer.json file in your project root.

{% highlight json %} { "require": { "altorouter/altorouter": "1.1.0" } } {% endhighlight %}

Tell Composer to install the required dependencies.

{% highlight bash %} php composer.phar install {% endhighlight %}

If you want to use the autoloading provided by Composer, add the following line to your application file.

{% highlight php startinline %} require 'vendor/autoload.php'; {% endhighlight %}

You are now ready to use the AltoRouter class. Rewrite all requests to your application file and start mapping your routes.

Install AltoRouter manually

Just download the AltoRouter class and require it in your application file.

{% highlight php startinline %} require 'AltoRouter.php'; {% endhighlight %}

Rewrite requests »