mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Should be able to get the directory from the Router.
This commit is contained in:
parent
a34451f01d
commit
3ab46df877
@ -48,6 +48,8 @@ class Router implements RouterInterface
|
||||
* Scans the URI and attempts to match the current URI to the
|
||||
* one of the defined routes in the RouteCollection.
|
||||
*
|
||||
* This is the main entry point when using the Router.
|
||||
*
|
||||
* @param null $uri
|
||||
*
|
||||
* @return mixed
|
||||
@ -120,6 +122,22 @@ class Router implements RouterInterface
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns the name of the sub-directory the controller is in,
|
||||
* if any. Relative to APPPATH.'controllers'.
|
||||
*
|
||||
* Only used when auto-routing is turned on.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function directory(): string
|
||||
{
|
||||
return ! empty($this->directory) ? $this->directory : '';
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
|
||||
/**
|
||||
* Sets the value that should be used to match the index.php file. Defaults
|
||||
* to index.php but this allows you to modify it in case your are using
|
||||
|
Loading…
x
Reference in New Issue
Block a user