Welcome Guest, Not a member yet? Register   Sign In
Add variables in routes with view
#1
Wink 

Add the ability to pass simple variables in the route for views. Sometimes we derive a route from a template where we want to pass a title or fixed variable, but it's not possible.

An example of how this would be used:

PHP Code:
$routes->view('/''login', ['title' => 'Login''message' => 'Welcome to login']);

$routes->view('change-password''change-pass', ['title' => 'Change Password']); 
Reply
#2

What for? You think only to yourself) Routes are not always used for HTTP, there is a CLI. The functionality will not be shared. Better apply the parameters in the controller, filter, and view decorator...
Simple CI 4 project for beginners codeigniter-expenses ( topic )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB