\App\ControllersAppController

BaseController.php

Mother class of all controllers

Summary

Methods
Properties
Constants
__construct()
render()
json()
redirect()
flash()
__get()
index()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$container
N/A

Properties

$container

$container : 

Type

Methods

__construct()

__construct(  $container) 

BaseController constructor.

Parameters

$container

render()

render(\Psr\Http\Message\ResponseInterface  $response, string  $view, array|null  $params = array()) 

View rendering function

Parameters

\Psr\Http\Message\ResponseInterface $response
string $view

View path (ViewFolder/ViewName) without extension

array|null $params

json()

json(\Psr\Http\Message\ResponseInterface  $response,   $data) : static

JSON rendering function

Parameters

\Psr\Http\Message\ResponseInterface $response
$data

Returns

static

redirect()

redirect(\Psr\Http\Message\ResponseInterface  $response, string  $name, array  $params = array(), integer  $status = 302) : static

Redirect function

Parameters

\Psr\Http\Message\ResponseInterface $response
string $name

Route name

array $params
integer $status

Returns

static

flash()

flash(  $type,   $message) 

Function that generates flash messages

Parameters

$type
$message

__get()

__get(  $name) : mixed

Attribute Getter

Parameters

$name

Returns

mixed

index()

index(\Psr\Http\Message\RequestInterface  $request, \Psr\Http\Message\ResponseInterface  $response) 

Parameters

\Psr\Http\Message\RequestInterface $request
\Psr\Http\Message\ResponseInterface $response