Jump to content


Render single record view when ID is passed with get route

routing

  • Please log in to reply
No replies to this topic

#1 carugnom

carugnom

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 25 November 2020 - 10:48 AM

Hi there !

I'm new to GC and I'm loving the way it helps with cruds :)

But I've found an issue I can't solve by myself

Following the video "Codeigniter 4 CRUD with Grocery CRUD | Tutorial Part 5", by the minute 6:30 I can see how routes are configured.

 

I've managed to develop my own resource crud, but I notice that the route that describes a 'get' with a parameter (id), is not working.

 

$routes->get('admin/customers/(:any)', 'Examples::customers_management/$1');

 

in fact the 'example' functions doesn't even receive the parameter, so that's why it does nothing.
If I pass an id parameter, I expect to see the 'read view' for that single record.

 

Does anyone know how to get that behavior working ?

I suspect it's a common issue

 

Thank you all !

Mario







Also tagged with one or more of these keywords: routing

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users