Welcome Guest, Not a member yet? Register   Sign In
Myth/Auth - Routing problem
#9

(04-13-2020, 06:39 AM)includebeer Wrote: I’m not sure if this is causing this, but you should set auto route to false if you are defining your own route.
It is looking for User:add instead of User::createUser, so I guess it’s the auto routing that gets in the way.

PHP Code:
$routes->setAutoRoute(false); 

Apparently not, because it changed to a value: 
Code:
Can't find a route for 'user/add'.

Environment: development says me:
Code:
DEFINED ROUTES
Method    Route            Handler
GET    user            \Modules\User\Controllers\User::index
POST    user/add    \Modules\User\Controllers\User::createUser
POST    user/load    \Modules\User\Controllers\User::load

In my : modules\User\Controllers\User.php

PHP Code:
    public function index() {
        return view('Modules\User\Views\Index');
    }

    public function createUser() {
        $model = new UserModel();
        $model->createUser($data = [
            'mail'        => $this->request->getPost('mail'),
            ...
            'timezone'    => $this->request->getPost('timezone')
        ]);
        return redirect()->back();
    
Reply


Messages In This Thread
Myth/Auth - Routing problem - by BilltheCat - 04-12-2020, 04:23 PM
RE: Myth/Auth - Routing problem - by includebeer - 04-12-2020, 06:17 PM
RE: Myth/Auth - Routing problem - by BilltheCat - 04-12-2020, 08:23 PM
RE: Myth/Auth - Routing problem - by BilltheCat - 04-13-2020, 04:25 AM
RE: Myth/Auth - Routing problem - by includebeer - 04-13-2020, 04:26 AM
RE: Myth/Auth - Routing problem - by BilltheCat - 04-13-2020, 04:46 AM
RE: Myth/Auth - Routing problem - by Nome - 04-13-2020, 06:16 AM
RE: Myth/Auth - Routing problem - by includebeer - 04-13-2020, 06:39 AM
RE: Myth/Auth - Routing problem - by Nome - 04-13-2020, 06:51 AM
RE: Myth/Auth - Routing problem - by includebeer - 04-13-2020, 07:08 AM
RE: Myth/Auth - Routing problem - by Nome - 04-13-2020, 07:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB