Welcome Guest, Not a member yet? Register   Sign In
Parameter passing through routing problem

I have a little routing problem, that i can't solve in Codeigniter 4.
I try adding a parameter at deleting list item. But get the following error messages.

> Error message at post routing: Controller or its method is not found:
> \App\Controllers\Userfeed::delete

> Error message at add or get routing: Controller or its method is not found:
> \App\Controllers\Pages::index

the route part:

[color=#333333][size=small][font=Tahoma, Verdana, Arial, sans-serif]//$routes->add('userfeed/(:any)', 'Pages/UserFeed::delete');//this works fine[/font][/size][/color]
[color=#333333][size=small][font=Tahoma, Verdana, Arial, sans-serif]$routes->get('userfeed/(:any)', 'Pages/UserFeed::delete');//this works fine[/font][/size][/color]
[color=#333333][size=small][font=Tahoma, Verdana, Arial, sans-serif]//$routes->get('userfeed/(:any)', 'Pages/UserFeed::delete/$1');//this is not work, which is the goal[/font][/size][/color]
[color=#333333][size=small][font=Tahoma, Verdana, Arial, sans-serif]//$routes->post('userfeed/(:any)', 'Pages/UserFeed::delete/$1');//this is not work[/font][/size][/color]
[color=#333333][size=small][font=Tahoma, Verdana, Arial, sans-serif]//$routes->add('userfeed/(:any)', 'Pages/UserFeed::delete/$1');//this is not work[/font][/size][/color]

the controller:

namespace App\Controllers\Pages;
use App\Controllers\MainCtrl;
class UserFeed extends MainCtrl{
public function delete($id=FALSE)

the view part:
<a class="badge badge-secondary" href="<?php echo base_url('userfeed/delete/'.$rss['id']);?>" >Töröl</a>

If need more information let it with me know. 

Thanks your help! Smile

Messages In This Thread
Parameter passing through routing problem - by csbb - 02-05-2021, 08:26 AM

Theme © iAndrew 2016 - Forum software by © MyBB