Welcome Guest, Not a member yet? Register   Sign In
CI4 Modules Routing
#4

(04-04-2020, 12:11 PM)mjamilasfihani Wrote:
(04-04-2020, 09:45 AM)lomali Wrote: Hello, I'm new at CI4, but I used CI3.

I wanted to work with modules at CI4. A tutorial on Youtube helped to set everything necessary. The problem now is that the methods and variables are not recognized by the controller.

This message always comes:
Controller or its method is not found: App\Controllers\Users:Confusedhow

Users is a controller in the Users module and show is the method. The URL is http://ocanext:8888/users/show/2

If I create a controller under App/Controllers, everything works without problems.

Where is the mistake?

Can you show how do you call the model?

<?php namespace Modules\Users\Controllers;

//use CodeIgniter\Controller;
//use CodeIgniter\API\ResponseTrait;

class Users extends \CodeIgniter\Controller {

//use ResponseTrait;

public function index() {
//return $this->respond([[1],[2]]);
echo 'testme';
}

public function show() {
//return $this->respond($id);
echo '$id';
}

public function create($id) {
echo $id;
}

public function update($id) {
echo $id;
}

public function delete($id) {
echo $id;
}

}
Reply


Messages In This Thread
CI4 Modules Routing - by lomali - 04-04-2020, 09:45 AM
RE: CI4 Modules Routing - by lomali - 04-04-2020, 11:11 AM
RE: CI4 Modules Routing - by mjamilasfihani - 04-04-2020, 12:11 PM
RE: CI4 Modules Routing - by lomali - 04-04-2020, 12:23 PM
RE: CI4 Modules Routing - by mjamilasfihani - 04-04-2020, 12:34 PM
RE: CI4 Modules Routing - by lomali - 04-04-2020, 12:45 PM
RE: CI4 Modules Routing - by davis.lasis - 04-04-2020, 01:55 PM
RE: CI4 Modules Routing - by lomali - 04-04-2020, 11:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB