¡Esta es una revisión vieja del documento!


Routing

What Are They? Routes allow you to make a specific page accessible via a unique URL.

Working With Routes Route configuration for your application can be changed by editing the application/configuration/routes.php file.</br>If you open this up it should look something like this:

routes.php

namespace Salem;
// Default Route
Route::add(  
array( 
'/' => 'mycontroller/functionHandler' , //this refers to your __domain.com/__ that will be manage the petition by the application/controllers/mycontroller.php file and launch the functionHandeler() fun respectively.
 
)//End of array
);
Let's say you had a page located at mycontroller/func/argument. Add that onto your domain name and you have a pretty long URL on your hands, so you want to be able to access that exact same page via the very small URL mypage. All you have to do is add a item into the array inside the routes.php file as above.

route::set('mypage','mycontroller/func/argument'); Now if you visit index.php/mypage you should see the exact same thing as if you visited index.php/mycontroller/func/argument.

Dynamic Routes Dingo also allows you to use regular expressions in your routes.

route::set('one/([a-zA-Z]+)/([0-9]+)','query/$1/$2'); The above would cause you to see index.php/query/test/123456 if you visited index.php/one/test/123456.