⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Render single record view when ID is passed with get route



carugnom

carugnom
  • profile picture
  • Member

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