FilesController
extends BaseController
in package
Class BaseController
BaseController provides a convenient place for loading components and performing functions that are needed by all your controllers. Extend this class in any new controllers: class Home extends BaseController
For security be sure to declare any new methods as protected or private.
Table of Contents
Properties
- $data : mixed
- $helpers : array<int, string>
- An array of helpers to be loaded automatically upon class instantiation. These helpers will be available to all other controllers that extend BaseController.
- $request : CLIRequest|IncomingRequest
- Instance of the main Request object.
- $uploads : mixed
- $user : mixed
Methods
- __construct() : mixed
- delete_file() : mixed
- get_live_route() : mixed
- index() : string
- initController() : void
- upload() : mixed
- load_common_data() : mixed
- load_uploaded_files() : mixed
- verify_upload_directory() : mixed
- verifies or creates the requested upload direcory
Properties
$data
protected
mixed
$data
= []
$helpers
An array of helpers to be loaded automatically upon class instantiation. These helpers will be available to all other controllers that extend BaseController.
protected
array<int, string>
$helpers
= ['device', 'download', 'csrf', 'user', 'front/dashboard', 'admin/header', 'admin/footer']
$request
Instance of the main Request object.
protected
CLIRequest|IncomingRequest
$request
$uploads
protected
mixed
$uploads
$user
protected
mixed
$user
Methods
__construct()
public
__construct() : mixed
delete_file()
public
delete_file() : mixed
get_live_route()
public
get_live_route(string $route, mixed ...$args) : mixed
Parameters
- $route : string
- $args : mixed
index()
public
index() : string
Return values
stringinitController()
public
initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) : void
Parameters
- $request : RequestInterface
- $response : ResponseInterface
- $logger : LoggerInterface
upload()
public
upload() : mixed
load_common_data()
private
load_common_data() : mixed
load_uploaded_files()
private
load_uploaded_files() : mixed
verify_upload_directory()
verifies or creates the requested upload direcory
private
verify_upload_directory(string $upload_directory) : mixed
Parameters
- $upload_directory : string
Return values
mixed —returns the upload path as string, false boolean on fail.