PHP5.3+ Routing Class. Lightweight yet extremely flexible. Supports REST, dynamic and reversed routing.
Questions tagged [altorouter]
56 questions
8
votes
1 answer
Routing via Php AltoRouter
I am trying to use a router (AltoRouter) for the first time and am unable to call any page.
Web folder structure
The Code
Index.php
require 'lib/AltoRouter.php';
$router = new…
user4248039
6
votes
2 answers
Altorouter multilingual routing
Is it possible to use Altorouter to create a multilingual routing setup?
I'd want to send a variable with the target file (so that it displays different contents when viewed), e.g. -
$router->map('GET','/th/work/sample', 'work/sample.php', 'sample',…

Staffan Estberg
- 6,795
- 16
- 71
- 107
4
votes
1 answer
Is this how AltoRouter GET POST method work?
I have been trying out this altorouter for weeks now. This is looks to be good router with not many working example either on the nets or the official site. You need to understand it somehow and get the job done.
I tried the basic GET and POST using…

Daksh B
- 269
- 1
- 8
- 45
4
votes
4 answers
PHP AltoRouter serving only base URL
I am a noobie in PHP, I am setting up a simple Routing using AltoRouter. Below is my index.php and .htaccess file which are at the route folder i.e, /var/www/html/
I am using Apache2 for serving the web pages.
index.php

user2379271
- 613
- 2
- 7
- 15
3
votes
1 answer
PHP AltoRouter - can't get GET request
For some reason I am not able to start AltoRouter. I am trying the most basic call, but nothing is happening. How can I make it work?
My index.php file looks like this:

Sasha
- 8,521
- 23
- 91
- 174
2
votes
1 answer
How to call controller->method with alto router
I'm trying to learn how to use alto router and what I want i'ts "pretty simple".
exemple:
"/" should call "AppController->index()"
"/profil" should call "ProfilController->profil()"
/profil/1" should call…

jeyremd
- 179
- 1
- 13
2
votes
1 answer
Mapping home controller as the default controller in AltoRouter
This is the index.php
setBasePath('/AltoRouter');
$router->map('GET','/', 'home_controller#index', 'home');
$router->map('GET','/content/[:parent]/?[:child]?',…

Daksh B
- 269
- 1
- 8
- 45
2
votes
2 answers
Trying to use PATCH method works with AJAX but not with a regular html form
I'm currently trying out http://altorouter.com/ and it's working well for me so far, except for this one issue I'm having
My route is set up like this:
$router->map( 'PATCH', '/admin/pages', 'pageController@update');
If I use the following jquery,…

EugeneB
- 21
- 2
2
votes
1 answer
Altorouter cant figure out how to route correctly PHP
if you haven't used this before the link is: http://altorouter.com/
I am making a small application but do not require a framework, only the routing part. So I've decided to try altorouter out as it seemed quite simple.
I want to map certain routes…

Matthew Smart
- 341
- 3
- 16
2
votes
1 answer
PHP AltoRouter Call a method on Controller
Trying to call a method on a controller but this wont work on AltoRouter
$router->map( 'GET', '/users/[i:id]/', 'UserController#showDetails' );
What I'm doing wrong?
PS:There is no example on how to get the parameters on the Controller method…

Gabriel Rodriguez
- 1,163
- 10
- 23
2
votes
1 answer
Displaying information from Twig don't work propertly
Have problem displaying information via Twig template.
I'm using Twig Template, AltoRouter.
AltoRouter code:
$router->map('GET','/[*]','Edion\Controllers\QuestionController@showCountMessage'
,'count_message');
Controller:
public…

Kintamasis
- 265
- 6
- 27
2
votes
0 answers
How to import AltoRoute controllers?
I'm creating a web app without any framework and I need a route. So i found AltoRoute as interesting solution. But I really don't understand how this working, I have read the documentation page but I have some question to ask. Hope that some one…

Sevengames Xoom
- 312
- 1
- 6
- 18
2
votes
1 answer
Using Alto Router in wamp server
Hi i want to use the package called Alto Router in wamp.
in www root i changed the index page with
map('GET','/',function(){
include(__DIR__ .…
user4412122
2
votes
1 answer
Empty GET to AltoRouter
I'm trying to use AltoRouter, but I'm trying to follow its documentation and my problem is that $_GET always to be empty.
I'm using Apache, and my .htaccess is like the following:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .…

Michael Alves
- 121
- 3
1
vote
1 answer
Problem with calling function with Alto Router package in PHP
I have a problem with calling function using alto routing. On index.php I I have my route that calls function that is in another file (test.php) and those two files are in the same directory (root). I get no response, but when I put that function…

mrmar
- 1,407
- 3
- 11
- 26