According to the PSR4 specification, the namespace of a controller class starts with plugin\{plugin_identifier}, for example:

Create a new controller file plugin/foo/app/controller/FooController.php.

namespace plugin\foo\app\controller;

use support\Request;

class FooController
    public function index(Request $request)
        return response('hello index');

    public function hello(Request $request)
        return response('hello webman');

When accessing, the page returns hello index.

When accessing, the page returns hello webman.

URL Access

The URL path for application plugin starts with /app, followed by the plugin identifier, and then the specific controller and method.

For example, the URL path for plugin\foo\app\controller\UserController is