RdbAdmin Module

Views
in package

Views class.

Tags
since
0.1

Table of Contents

Properties

$Container  : Container
$controllerMethod  : string
$Modules  : Modules

Methods

__construct()  : mixed
Load the views file.
render()  : string
Render the views file.
locateViews()  : string
Locate views file.

Properties

$controllerMethod

protected string $controllerMethod

The controller class and method that call the views. This is useful in hook. Result example: Rdb\Modules\RdbAdmin\Controllers\Admin\Users\EditController->indexAction

Tags
since
0.2.3

Methods

__construct()

Load the views file.

public __construct(Container $Container) : mixed
Parameters
$Container : Container

The DI container class.

render()

Render the views file.

public render(string $viewsFile[, array<string|int, mixed> $data = [] ][, array<string|int, mixed> $options = [] ]) : string
Parameters
$viewsFile : string

The views file name. This depend on option noLocateViews. If this option was not set or set to false then the views file is locate from "Views" folder in the running module and no need to add ".php" extension. If this option was set to true then the views file MUST be full path to the file (.php extension is required).

$data : array<string|int, mixed> = []

The data that will becomes variable in views file. Example ['foo' => 'bar']; will becomes echo $foo; // result is bar.

$options : array<string|int, mixed> = []

The options for render the views. noLocateViews Set to true to tell that views file is already full path, no need to locate full path to the file.
viewsModule Set the module folder name to locate views in there.

Return values
string

Return views content.

locateViews()

Locate views file.

protected locateViews(string $viewsFile[, string $currentModule = null ]) : string
Parameters
$viewsFile : string

The views file name without .php extension.

$currentModule : string = null

The module folder name to locate views in there. Default is null to auto detect current module but auto detect did not work in all case.

Tags
throws
RuntimeException

Throw exception if views file was not found.

Return values
string

Return full path to views file if the file was found.


        
On this page

Search results