\Hazaar
View
Summary
Methods Properties Constants
get
has
set
yn
No constants
Properties
$_data
$_data
$_helpers
$_helpers
View Helpers
$_helpers_init
$_helpers_init
Array for storing names of initialised helpers so we only initialise them once
$_methodHandler
$_methodHandler
$_rendering
$_rendering
$_scripts
$_scripts
$_viewfile
$_viewfile
$name
$name
Methods
__call()
__call($method, $args)

Parameters

$method

No description

$args

No description

__construct()
__construct($view, $init_helpers = Array ( ) )

Parameters

$view

No description

$init_helpers

No description

__get()
__get($helper)

Parameters

$helper

No description

__isset()
__isset($key)

Parameters

$key

No description

__set()
__set($key, $value)

Parameters

$key

No description

$value

No description

__unset()
__unset($key)

Parameters

$key

No description

addHelper()
addHelper($helper, $args = Array ( ) , $alias = null)

Parameters

$helper

No description

$args

No description

$alias

No description

date()
date($date) : string
Returns a date string formatted to the current set date format

Parameters

$datemixed

No description

Returns

string
Static
datetime()
datetime($value, $format = null) : string
Return a formatted date as a string.

Parameters

$valuemixed

This can be practically any date type. Either a \Hazaar\Date object, epoch int, or even a string.

$formatmixed

Optionally specify the format to display the date. Otherwise the current default is used.

Returns

string

The nicely formatted datetime string.

extend()
extend($array)

Parameters

$arrayarray

No description

get()
get($helper, $default = null)

Parameters

$helper

No description

$default

No description

getData()
getData()
getHelper()
getHelper($key)

Parameters

$key

No description

getHelpers()
getHelpers()
getName()
getName()
getViewFile()
getViewFile()
Static
getViewPath()
getViewPath($view, $name)

Parameters

$view

No description

$name

No description

gravatar()
gravatar($address, $default = null) : \Hazaar\Html\Img
Display a Gravatar icon for a users email address.

Parameters

$addressstring

The email address to show the gravatar image for.

$defaultstring

The default image to use if none is available. This can be either a URL to a supported image, or one of gravatars built-in default images. See the “Default Image” section of https://en.gravatar.com/site/implement/images/ for available options.

Returns

\Hazaar\Html\Img

An IMG object so that extra options can be applied.

has()
has($key)

Parameters

$key

No description

hasHelper()
hasHelper($helper)

Parameters

$helper

No description

initHelpers()
initHelpers()
load()
load($view)

Parameters

$view

No description

partial()
partial($view, $data = Array ( ) )

Parameters

$view

No description

$dataarray

No description

partialLoop()
partialLoop($view, $data) : string
Render a partial view multiple times on an array

Parameters

$viewmixed

The partial view to render

$dataarray

A data array. Usually multi-dimensional

Returns

string
populate()
populate($array)

Parameters

$array

No description

registerController()
registerController($controller)
Registers a controller on the view for method callbacks.

Tags

Deprecated

Replaced by Hazaar\View::registerMethodHandler().

Parameters

$controller

No description

registerMethodHandler()
registerMethodHandler($handler)
Registers an object on the view for method callbacks.

Tags

Throws

\Exception

Parameters

$handler

No description

remove()
remove($key)

Parameters

$key

No description

removeHelper()
removeHelper($helper)

Parameters

$helper

No description

render()
render()
runHelpers()
runHelpers()
script()
script($code)

Parameters

$code

No description

set()
set($key, $value)

Parameters

$key

No description

$value

No description

setRequiresParam()
setRequiresParam($array)

Parameters

$array

No description

Static
timestamp()
timestamp($value) : string
Return a date/time type as a timestamp string.

This is for making it quick and easy to output consistent timestamp strings.

Parameters

$valuemixed

No description

Returns

string
yn()
yn($value, $labels = Array ( [0] => Yes ) ) : string
Returns 'Yes' or 'No' text based on a boolean value

Parameters

$valuemixed

The boolean value

$labelsmixed

Optionally specify your own yes/no text to display

Returns

string