PHP Class App\Core\Controller

Show file Open project: nova-framework/framework Class Usage Examples

Protected Properties

Property Type Description
$layout string The currently used Layout.
$template string The currently used Template.

Public Methods

Method Description
__construct ( ) Create a new Controller instance.
getLayout ( string | null $layout = null, array $data = [] ) : Template\Template | View\View Return a Layout instance.
getLayoutName ( ) : string Return the current Layout (class) name.
getTemplate ( ) : string Return the current Template name.

Protected Methods

Method Description
getView ( array $data = [] ) : Nova\View\View Return a default View instance.
processResponse ( mixed $response ) : Response Create from the given result a Response instance and send it.

Method Details

__construct() public method

Create a new Controller instance.
public __construct ( )

getLayout() public method

Return a Layout instance.
public getLayout ( string | null $layout = null, array $data = [] ) : Template\Template | View\View
$layout string | null
$data array
return Template\Template | View\View

getLayoutName() public method

Return the current Layout (class) name.
public getLayoutName ( ) : string
return string

getTemplate() public method

Return the current Template name.
public getTemplate ( ) : string
return string

getView() protected method

Return a default View instance.
protected getView ( array $data = [] ) : Nova\View\View
$data array
return Nova\View\View

processResponse() protected method

Create from the given result a Response instance and send it.
protected processResponse ( mixed $response ) : Response
$response mixed
return Symfony\Component\HttpFoundation\Response

Property Details

$layout protected property

The currently used Layout.
protected string $layout
return string

$template protected property

The currently used Template.
protected string $template
return string