Properties

$template

$template : string

Template name

Type

string

$page

$page : string

Name of the current page, respectively the name of the folder where the view is located

Type

string

$action

$action : string

Name of the current action, respectively the name of the view in the page folder

Type

string

$attributes

$attributes : array<mixed,mixed>

Variables stored for use in view

Type

array<mixed,mixed>

$content

$content : string

View content

Type

string

$extension

$extension : string

View file extension

Type

string

$viewPath

$viewPath : string

View path

Type

string

$viewFullPath

$viewFullPath : string

Stores the view full

Type

string

$templateFullPath

$templateFullPath : string

Stores the template full

Type

string

Methods

addFlash()

addFlash(string  $type, string|array  $message) : \MocaBonita\view\MbView

Parameters

string $type
string|array $message

Returns

\MocaBonita\view\MbView

getFlash()

getFlash(string  $name, array  $default = array()) 

Parameters

string $name
array $default

getFlashes()

getFlashes() : array<mixed,array>

Returns

array<mixed,array>

hasFlash()

hasFlash(string  $name) : boolean

Parameters

string $name

Returns

boolean

successFlash()

successFlash(string|array  $message, string  $type = 'success') : \MocaBonita\view\MbView

Parameters

string|array $message
string $type

Returns

\MocaBonita\view\MbView

errorFlash()

errorFlash(string|array  $message, string  $type = 'error') : \MocaBonita\view\MbView

Parameters

string|array $message
string $type

Returns

\MocaBonita\view\MbView

infoFlash()

infoFlash(string|array  $message, string  $type = 'info') : \MocaBonita\view\MbView

Parameters

string|array $message
string $type

Returns

\MocaBonita\view\MbView

warnFlash()

warnFlash(string|array  $message, string  $type = 'warn') : \MocaBonita\view\MbView

Parameters

string|array $message
string $type

Returns

\MocaBonita\view\MbView

exceptionFlash()

exceptionFlash(\Exception  $exception, string  $type = 'error') : \MocaBonita\view\MbView

Parameters

\Exception $exception
string $type

Returns

\MocaBonita\view\MbView

__construct()

__construct() 

View construct.

getViewFullPath()

getViewFullPath() : string

Returns

string

setViewFullPath()

setViewFullPath(string  $viewFullPath) : \MocaBonita\view\MbView

Parameters

string $viewFullPath

Returns

\MocaBonita\view\MbView

getTemplateFullPath()

getTemplateFullPath() : string

Returns

string

setTemplateFullPath()

setTemplateFullPath(string  $templateFullPath) : \MocaBonita\view\MbView

Parameters

string $templateFullPath

Returns

\MocaBonita\view\MbView

getTemplate()

getTemplate() : string

Get template name

Returns

string

setTemplate()

setTemplate(string  $template) : \MocaBonita\view\MbView

Set template name

Parameters

string $template

Returns

\MocaBonita\view\MbView

getPage()

getPage() : string

Get page name

Returns

string

setPage()

setPage(string  $page) : \MocaBonita\view\MbView

Set page name

Parameters

string $page

Returns

\MocaBonita\view\MbView

getAction()

getAction() : string

Get action name

Returns

string

setAction()

setAction(string  $action) : \MocaBonita\view\MbView

Set action name

Parameters

string $action

Returns

\MocaBonita\view\MbView

getAttribute()

getAttribute(null  $name = null) : array<mixed,mixed>

Get variables for view

Parameters

null $name

Returns

array<mixed,mixed>

setAttributes()

setAttributes(array<mixed,string>  $attributes) : \MocaBonita\view\MbView

Set variables for view

Parameters

array<mixed,string> $attributes

Returns

\MocaBonita\view\MbView

setAttribute()

setAttribute(string  $name, mixed  $value) : \MocaBonita\view\MbView

Set variable for view

Parameters

string $name
mixed $value

Returns

\MocaBonita\view\MbView

getContent()

getContent() : string

Get content view

Returns

string

setContent()

setContent(string  $content) : \MocaBonita\view\MbView

Set content view

Parameters

string $content

Returns

\MocaBonita\view\MbView

getExtension()

getExtension() : string

Get view file extension

Returns

string

setExtension()

setExtension(string  $extension) : \MocaBonita\view\MbView

Set view file extension

Parameters

string $extension

Returns

\MocaBonita\view\MbView

getViewPath()

getViewPath() : string

Get view path

Returns

string

setViewPath()

setViewPath(string  $viewPath) : \MocaBonita\view\MbView

Set view path

Parameters

string $viewPath

Returns

\MocaBonita\view\MbView

setView()

setView(string  $templateName, string  $page, string  $action, array  $attributes = array(), string  $extension = "phtml") : \MocaBonita\view\MbView

Set parameters for view

Parameters

string $templateName
string $page
string $action
array $attributes
string $extension

Returns

\MocaBonita\view\MbView

piece()

piece(string  $filePiece) : void

Get a piece to include in the view

Parameters

string $filePiece

File part address

render()

render() : string

Get the evaluated contents of the object.

Returns

string

name()

name() : string

Get the name of the view.

Returns

string

with()

with(string|array  $key, mixed  $value = null) : $this

Add a piece of data to the view.

Parameters

string|array $key
mixed $value

Returns

$this

__toString()

__toString() : string

Convert the model to its string representation.

Returns

string

__get()

__get(string  $key) : mixed

Dynamically retrieve attributes on the view.

Parameters

string $key

Returns

mixed

__set()

__set(string  $key, mixed  $value) : void

Dynamically set attributes on the view.

Parameters

string $key
mixed $value

getFileFullPath()

getFileFullPath(string  $type = 'action') : string

Get File Full Path with extension

Parameters

string $type

If the file either is a view or is a template

Returns

string