.. SlaxWeb Framework routes file, created by Tomaz Lovrec .. highlight:: php .. _guide routes: Routes ====== First thing we need to do, is define some routes. SlaxWeb Framework does not automatically route any requests to any of your controllers based on some URL parameters, which means we will have to define 4 routes for 4 of our pages, including one more route for saving the newly created and/or edited news article. You can find more details regarding the routing in the :ref:`gen topics routing` documentation. Route collection file --------------------- First we are going to create a Route collection file, by default located in **app/Routes**. The Route collection file must define a class in the **\\App\\Routes** namespace, which can of course be changed, as long as it remains autoloaded by the :ref:`composer autoloader section`. For more information about changing the namespace and/or the location please refer to :ref:`change autoloader` section of the documentation. We will assume that you did not change the location of the file, nor the namespace, if you did, please alter the namespace in the examples bellow before using them. We are going to create a file named **NewsCollection.php** in **app/Routes** directory with the following contents:: routes[] = [ "uri" => "", "method" => Route::METHOD_GET, "action" => function ( Request $request, Response $response, Application $app ) { // body } ]; } And we have defined a root route. It does nothing right now, since its body is completely empty. This route will get executed when a visitor reaches the root page of our new website.