Welcome Guest, Not a member yet? Register   Sign In
Dealing with route (universal search)
#4

I think I understand what you're talking about. In this case, I would recommend having default values in the URL. For example, https://www.mysite.com/_low_/20230815/jack/_info_ where __low_ is the default priority, _info_ is the information if it is not set.


Or you can create several rules for each case when some parameter is missing. Replace it with the default string.
You need to check this solution, I can't say right now.


PHP Code:
<?php
// Var filled from URL
// Calls $model>list($prior = '__low_', $date, $user, $info = '__info_')
$routes->get('(:segment)/(:segment)''Model::list/_low_/$2/$3/_info_);

// Calls $model>list($prior, $date, $user, $info)
$routes->get('
(:segment)/(:segment)/(:segment)/(:segment)', 'Model::list/$1/$2/$3/$4'); 
Simple CI 4 project for beginners codeigniter-expenses ( topic )
Reply


Messages In This Thread
RE: Dealing with route (universal search) - by ozornick - 08-16-2023, 01:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB