CategoriesView

Extends HtmlView

Categories view base class.

since

3.2

package

Application

Methods

__construct

Class constructor, overridden in descendant classes.

__construct(mixed properties = null) : mixed
inherited
since

1.7.0

Arguments

properties

mixedEither and associative array or another object to set the initial properties of the object.

Response

mixed

__toString

Magic method to convert the object to a string gracefully.

__toString() : string
inherited deprecated
since

1.7.0

deprecated

3.1.4 Classes should provide their own __toString() implementation.

Response

stringThe classname.

_addPath

Adds to the search path for templates and resources.

_addPath(string type, mixed path) : void
inherited
since

3.0

Arguments

type

stringThe type of path to add.

path

mixedThe directory or stream, or an array of either, to search.

_createFileName

Create the filename for a resource

_createFileName(string type, array parts = array()) : string
inherited
since

3.0

Arguments

type

stringThe resource type to create the filename for

parts

arrayAn associative array of filename information

Response

stringThe filename

_setPath

Sets an entire array of search paths for templates or resources.

_setPath(string type, mixed path) : void
inherited
since

3.0

Arguments

type

stringThe type of path to set, typically 'template'.

path

mixedThe new search path, or an array of search paths. If null or false, resets to the current directory only.

addHelperPath

Adds to the stack of helper script paths in LIFO order.

addHelperPath(mixed path) : void
inherited
since

3.0

Arguments

path

mixedA directory path or an array of paths.

addTemplatePath

Adds to the stack of view script paths in LIFO order.

addTemplatePath(mixed path) : void
inherited
since

3.0

Arguments

path

mixedA directory path or an array of paths.

def

Sets a default value if not already assigned

def(string property, mixed default = null) : mixed
inherited
since

1.7.0

Arguments

property

stringThe name of the property.

default

mixedThe default value.

Response

mixed

dispatchEvent

Dispatches the given event on the internal dispatcher, does a fallback to the global one.

dispatchEvent(\Joomla\Event\EventInterface event) : void
inherited
since

4.1.0

Arguments

event

\Joomla\Event\EventInterfaceThe event

display

Execute and display a template script.

display(string tpl = null) : void
inherited abstract
since

3.0

Arguments

tpl

stringThe name of the template file to parse; automatically searches through the template paths.

escape

Escapes a value for output in a view script.

escape(mixed var) : mixed
inherited

If escaping mechanism is htmlspecialchars, use {@link} setting.

note

the ENT_COMPAT flag was replaced by ENT_QUOTES in Joomla 4.0 to also escape single quotes

since

3.0

Arguments

var

mixedThe output to escape.

Response

mixedThe escaped value.

get

Returns a property of the object or the default value if the property is not set.

get(string property, mixed default = null) : mixed
inherited
since

1.7.0

see CMSObject::getProperties()

Arguments

property

stringThe name of the property.

default

mixedThe default value.

Response

mixedThe value of the property.

getError

Get the most recent error message.

getError(int i = null, bool toString = true) : string
inherited deprecated
since

1.7.0

deprecated

3.1.4 JError has been deprecated

Arguments

i

intOption error index.

toString

boolIndicates if Exception objects should return their error message.

Response

stringError message

getErrors

Return all errors, if any.

getErrors() : array
inherited deprecated
since

1.7.0

deprecated

3.1.4 JError has been deprecated

Response

arrayArray of error messages.

getForm

Returns the form object

getForm() : mixed
inherited
since

3.2

Response

mixedA \JForm object on success, false on failure

getLayout

Get the layout.

getLayout() : string
inherited
since

3.0

Response

stringThe layout name

getLayoutTemplate

Get the layout template.

getLayoutTemplate() : string
inherited
since

3.0

Response

stringThe layout template name

getModel

Method to get the model object

getModel(string name = null) : \Joomla\CMS\MVC\Model\BaseDatabaseModel
inherited
since

3.0

Arguments

name

stringThe name of the model (optional)

Response

\Joomla\CMS\MVC\Model\BaseDatabaseModelThe model object

getName

Method to get the view name

getName() : string
inherited

The model name by default parsed using the classname, or it can be set by passing a $config['name'] in the class constructor

since

3.0

throws

\Exception

Response

stringThe name of the model

getProperties

Returns an associative array of object properties.

getProperties(bool public = true) : array
inherited
since

1.7.0

see CMSObject::get()

Arguments

public

boolIf true, returns only the public properties.

Response

array

loadHelper

Load a helper file

loadHelper(string hlp = null) : void
inherited
since

3.0

Arguments

hlp

stringThe name of the helper source file automatically searches the helper paths and compiles as needed.

loadTemplate

Load a template file -- first look in the templates folder for an override

loadTemplate(string tpl = null) : string
inherited
since

3.0

throws

\Exception

Arguments

tpl

stringThe name of the template source file; automatically searches the template paths and compiles as needed.

Response

stringThe output of the the template script.

prepareDocument

Prepares the document

prepareDocument() : void
since

3.2

set

Modifies a property of the object, creating it if it does not already exist.

set(string property, mixed value = null) : mixed
inherited
since

1.7.0

Arguments

property

stringThe name of the property.

value

mixedThe value of the property to set.

Response

mixedPrevious value of the property.

setDocumentTitle

Sets the document title according to Global Configuration options

setDocumentTitle(string title) : void
inherited
since

3.6

Arguments

title

stringThe page title

setError

Add an error message.

setError(string error) : void
inherited deprecated
since

1.7.0

deprecated

3.1.4 JError has been deprecated

Arguments

error

stringError message.

setLayout

Sets the layout name to use

setLayout(string layout) : string
inherited
since

3.0

Arguments

layout

stringThe layout name or a string in format