Welcome Guest, Not a member yet? Register   Sign In
How to use parameter in redirect function
#4

(This post was last modified: 02-13-2021, 11:38 AM by ikesela.)

make sure to name the route :
EXAMPLE:

Code:
//ROUTE
$routes->get('ViewStudentProfile/(:segment)', 'Student_Controller::ViewStudentProfile/$1',['as' => 'profile']);

// LINK TO USE ( route_to is working for this)

route_to('profile',$student_id);

// controller
public function ViewStudentProfile(int $studentId)
{
// ...your code here and return view(..)
}

or maybe can try:

redirect()->route('route_name',$param)
Reply


Messages In This Thread
RE: How to use parameter in redirect function - by ikesela - 02-13-2021, 11:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB