Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is reverse routing?

Really, it's mentioned everywhere but there is even no wikipedia page named exactly that. Is this just a fancy name for URL redirecting? Does it have another name or definition?

like image 717
Caballero Avatar asked Oct 23 '13 18:10

Caballero


People also ask

What is reverse routing in networking?

Reverse routing is the process of generating the URL that would lead to a route, given a symbolic reference to the route (could be name of the route/view/controller or a reference to the controller, depending on the framework).

What is inverse route?

Laravel Reverse routing is the process of generating the URL based on name or symbol. It generates URL's based on route declarations. Reverse routing makes your application so much more flexible and helps the developer to write cleaner codes in View. It defines a relationship between links and Laravel routes.

What is reverse routing in PHP?

Reverse-routing is generating URLs based on route declarations. For example the following route declaration tells Laravel to execute the action “register” in the controller “users” when the request's URI is 'register'.

What is route in Laravel?

All Laravel routes are defined in your route files, which are located in the routes directory. These files are automatically loaded by your application's App\Providers\RouteServiceProvider . The routes/web.php file defines routes that are for your web interface.


1 Answers

Reverse routing is the process of generating the URL that would lead to a route, given a symbolic reference to the route (could be name of the route/view/controller or a reference to the controller, depending on the framework).

(This is "reverse routing" because it's the opposite of normal routing or forward routing, which maps from a URL to a route specifying the view or controller.)

Examples for various frameworks:

  • Django has the url template tag and the urlresolvers.reverse helper method
  • flask has url_for
  • Rails has link_to
like image 191
metamatt Avatar answered Sep 29 '22 06:09

metamatt