Skip to content

Routing

Niamul Hasan edited this page Jan 18, 2021 · 2 revisions

Routing list routes/web_routes.php

Defining routes

Route::set('signup', function () {
    UserController::createView('Users/SignupView');
});

For Passing Parameters use the get method

Route::get('user/$id/$postTitle', function ($params = array()) {
    echo "user and then id-";
    print_r($params); //Output: Array ( [id] => 342, [postTitle] => Title-of-a-post-from-browser-url )
});

You can get all the Parameters values in $params array

Here, $params array is an associative array with the keys named as you gave in the route URL (first parameter of the get method)

Clone this wiki locally