CodeIgniter v4.5 API

ControllerMethodReader
in package

FinalYes

Reads a controller and returns a list of auto route listing.

Tags
see
ControllerMethodReaderTest

Table of Contents

Properties

$namespace  : string

Methods

__construct()  : mixed
read()  : array<int, array{route: string, handler: string}>
getRouteWithoutController()  : array<string|int, mixed>
Gets a route without default controller.
getUriByClass()  : string
hasRemap()  : bool
Whether the class has a _remap() method.

Properties

Methods

__construct()

public __construct(string $namespace) : mixed
Parameters
$namespace : string

the default namespace

read()

public read(class-string $class[, string $defaultController = 'Home' ][, string $defaultMethod = 'index' ]) : array<int, array{route: string, handler: string}>
Parameters
$class : class-string
$defaultController : string = 'Home'
$defaultMethod : string = 'index'
Return values
array<int, array{route: string, handler: string}>

getRouteWithoutController()

Gets a route without default controller.

private getRouteWithoutController(string $classShortname, string $defaultController, string $uriByClass, string $classname, string $methodName) : array<string|int, mixed>
Parameters
$classShortname : string
$defaultController : string
$uriByClass : string
$classname : string
$methodName : string
Return values
array<string|int, mixed>

getUriByClass()

private getUriByClass(class-string $classname) : string
Parameters
$classname : class-string
Return values
string

URI path part from the folder(s) and controller

hasRemap()

Whether the class has a _remap() method.

private hasRemap(ReflectionClass $class) : bool
Parameters
$class : ReflectionClass
Return values
bool

        
On this page

Search results