Welcome Guest, Not a member yet? Register   Sign In
Route passing $1 into the controller function instead of the value
#1

Hi team,
I have a new issue that is confusing me 
Using CodeIgnighter4, I have routes set up :
$routes->get("Entry/(:any)",'Home::Entry/$1');
$routes->get("LoadEvents/(:any)",'Home::Load_Events/$l/$2');

In the Controller:
    public function Entry($Hive_ID,$Entry_ID){ blah blah....}
    public function Load_Events($BeeKeeper_ID,$mth){
        echo "$BeeKeeper_ID<br>";
        echo "$mth<br>";


The Entry route works without issue... (tested from the application and from postman)
The Load_Events route echoes $1 as $BeeKeeper and nothing for $mth

Can anyone shed some light on this behaviour ? 

I have tried 
$routes->get("LoadEvents/(:any)",'Home::Load_Events/$l'); 
$routes->get("LoadEvents/(:any)/(:any)",'Home::Load_Events/$l/$2');
as well to no avail...


Any assistance will be appreciated.
Reply


Messages In This Thread
Route passing $1 into the controller function instead of the value - by Alex.Fry - 05-22-2025, 12:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB