Welcome Guest, Not a member yet? Register   Sign In
Controller in subdirectory
#2

(This post was last modified: 06-19-2021, 04:34 PM by venance.)

You need to specify the namespace and the namespace of the extended class or BaseController.

PHP Code:
//routes
$routes->get('/api/(:any)''Api\Internal::bounce/$1');

//controller inside Api directory--- App/Controlles/Api/Internal.php
//localhost/projectname/public/api/internal/bounce

namespace App\Controllers;
use 
App\Controllers\BaseController;

class 
Internal extends BaseController
{
      public function __construct(){}

      public function bounce(){}

Reply


Messages In This Thread
Controller in subdirectory - by TaylorHicks - 06-19-2021, 03:30 PM
RE: Controller in subdirectory - by venance - 06-19-2021, 04:03 PM
RE: Controller in subdirectory - by TaylorHicks - 06-19-2021, 04:54 PM
RE: Controller in subdirectory - by venance - 06-24-2021, 03:45 PM
RE: Controller in subdirectory - by InsiteFX - 06-24-2021, 09:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB