![]() |
Hi,
PHP Code: public function wpis($id) { $dzis = Time::today('Europe/Warsaw', 'pl_PL'); $data['menu']=1; $modelw = new Blog_m(); if(isset($id)) { $data['id']=$id; } else { return redirect()->to('blog'); } etc... And in Routing I put: PHP Code: $routes->get('', 'FRONT/Page::index'); PHP Code: $routes->get('wpis/(:num)', 'FRONT/Blog::wpis'); PHP Code: Too few arguments to function App\Controllers\FRONT\Blog::wpis(), 0 passed in $routes->ge
there is no route for /wpis , existing route is /wpis/{num}
alternatively can add this for default route: $routes->get('wpis', 'FRONT/Blog::wpis'); change function to: public function wpis($id = 0) // for default route (02-12-2022, 10:58 PM)iRedds Wrote: https://forum.codeigniter.com/thread-805...#pid391775Thanks, but unfortunelly: PHP Code: $routes->get('', 'FRONT\Page::index');
Namespace uses a back slash \ not a forward slash /
FRONT\Blog::wpis/$1 What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
for testin I do:
public function wpis($id=0) and add in Routes $routes->get('/wpis', 'FRONT\Blog:wpis'); $routes->get('/wpis/(:num)', 'FRONT\Blog::wpis/$1'); now, in url when I go in: https://url/wpis i get: ErrorException Undefined array key 1 SYSTEMPATH/Router/Router.php at line 430 strange things below stil not works $routes->get('/wpis/(:num)', 'FRONT\Blog::wpis/$1');
WORRRKSS!!!
$routes->get('/wpis/(:num)', 'Front\Blog::wpis/$1', ['namespace' => 'App\Controllers']);
This is the default namespace.
$routes->setDefaultNamespace('App\Controllers');
Yes, but work with this, without not.
Hmm, maybe: $routes->setDefaultNamespace('App/Controllers'); herer is wrong slash |
Welcome Guest, Not a member yet? Register Sign In |