PHP Класс FOF30\View\ViewTemplateFinder

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$container The container of the view, for quick reference
$defaultLayout Default layout's name (default: "default")
$defaultTpl Default subtemplate name (default: empty)
$extensions The layout template extensions to look for
$sidePrefix Which application side prefix should I use by default (site, admin, auto, any)
$strictLayout Should Should I only look for this layout or also the default layout?
$strictTpl Should I only look for the defined subtemplate or also no subtemplate?
$strictView Should I only look in the specified view (true) or also the pluralised/singularised (false)
$view The view we are attached to

Открытые методы

Метод Описание
__construct ( View $view, array $config = [] ) Public constructor. The config array can contain the following keys extensions array defaultLayout string defaultTpl string strictView bool strictTpl bool strictLayout bool sidePrefix string For the descriptions of each key please see the same-named property of this class
addExtension ( string $extension ) : void Add an extension to the list of view template extensions
getDefaultLayout ( ) : string Returns the default layout name
getDefaultTpl ( ) : string Returns the default subtemplate name
getExtensions ( ) : array Get the list of view template extensions
getSidePrefix ( ) : string Returns the application side prefix which will be used by default in getViewTemplateUris. It can be one of: site Public front-end admin Administrator back-end auto Automatically figure out if it should be site or admin any First look in the current application side, then look on the other side of the application
getViewTemplateUris ( array $parameters ) : array Returns a list of template URIs for a specific component, view, template and sub-template. The $parameters array can have any of the following keys: component string The name of the component, e.g. com_something view string The name of the view layout string The name of the layout tpl string The name of the subtemplate strictView bool Should I only look in the specified view, or should I look in the pluralised/singularised view as well? strictLayout bool Should I only look for this layout, or also for the default layout? strictTpl bool Should I only look for this subtemplate or also for no subtemplate? sidePrefix string The application side prefix (site, admin, auto, any)
isStrictLayout ( ) : boolean Returns the "strict layout" flag. When the flag is false we will look for a view template with both the specified and the default template name in getViewTemplateUris. When true we will only look for the specified view template.
isStrictTpl ( ) : boolean Returns the "strict template" flag. When the flag is false we will look for a view template with or without the subtemplate defined in getViewTemplateUris. If it's true we will only look for the subtemplate specified.
isStrictView ( ) : boolean Returns the "strict view" flag. When the flag is false we will look for the view template in both the singularised and pluralised view. If it's true we will only look for the view template in the view specified in getViewTemplateUris.
parseTemplateUri ( string $uri = '' ) : array Parses a template URI in the form of admin:component/view/layout to an array listing the application section (admin, site), component, view and template referenced therein.
removeExtension ( string $extension ) : void Remove an extension from the list of view template extensions
resolveUriToPath ( string $uri, string $layoutTemplate = '', array $extraPaths = [] ) : string Resolves a view template URI (e.g. any:com_foobar/Items/cheese) to an absolute filesystem path (e.g. /var/www/html/administrator/components/com_foobar/View/Items/tmpl/cheese.php)
setDefaultLayout ( string $defaultLayout ) : void Sets the default layout name
setDefaultTpl ( string $defaultTpl ) Sets the default subtemplate name
setExtensions ( array $extensions ) : void Set the list of view template extensions
setSidePrefix ( string $sidePrefix ) : void Sets the application side prefix which will be used by default in getViewTemplateUris. It can be one of: site Public front-end admin Administrator back-end auto Automatically figure out if it should be site or admin any First look in the current application side, then look on the other side of the application
setStrictLayout ( boolean $strictLayout ) : void Sets the "strict layout" flag. When the flag is false we will look for a view template with both the specified and the default template name in getViewTemplateUris. When true we will only look for the specified view template.
setStrictTpl ( boolean $strictTpl ) : void Sets the "strict template" flag. When the flag is false we will look for a view template with or without the subtemplate defined in getViewTemplateUris. If it's true we will only look for the subtemplate specified.
setStrictView ( boolean $strictView ) : void Sets the "strict view" flag. When the flag is false we will look for the view template in both the singularised and pluralised view. If it's true we will only look for the view template in the view specified in getViewTemplateUris.

Описание методов

__construct() публичный Метод

Public constructor. The config array can contain the following keys extensions array defaultLayout string defaultTpl string strictView bool strictTpl bool strictLayout bool sidePrefix string For the descriptions of each key please see the same-named property of this class
public __construct ( View $view, array $config = [] )
$view View The view we are attached to
$config array The configuration for this view template finder

addExtension() публичный Метод

Add an extension to the list of view template extensions
public addExtension ( string $extension ) : void
$extension string
Результат void

getDefaultLayout() публичный Метод

Returns the default layout name
public getDefaultLayout ( ) : string
Результат string

getDefaultTpl() публичный Метод

Returns the default subtemplate name
public getDefaultTpl ( ) : string
Результат string

getExtensions() публичный Метод

Get the list of view template extensions
public getExtensions ( ) : array
Результат array

getSidePrefix() публичный Метод

Returns the application side prefix which will be used by default in getViewTemplateUris. It can be one of: site Public front-end admin Administrator back-end auto Automatically figure out if it should be site or admin any First look in the current application side, then look on the other side of the application
public getSidePrefix ( ) : string
Результат string

getViewTemplateUris() публичный Метод

Returns a list of template URIs for a specific component, view, template and sub-template. The $parameters array can have any of the following keys: component string The name of the component, e.g. com_something view string The name of the view layout string The name of the layout tpl string The name of the subtemplate strictView bool Should I only look in the specified view, or should I look in the pluralised/singularised view as well? strictLayout bool Should I only look for this layout, or also for the default layout? strictTpl bool Should I only look for this subtemplate or also for no subtemplate? sidePrefix string The application side prefix (site, admin, auto, any)
public getViewTemplateUris ( array $parameters ) : array
$parameters array See above
Результат array

isStrictLayout() публичный Метод

Returns the "strict layout" flag. When the flag is false we will look for a view template with both the specified and the default template name in getViewTemplateUris. When true we will only look for the specified view template.
public isStrictLayout ( ) : boolean
Результат boolean

isStrictTpl() публичный Метод

Returns the "strict template" flag. When the flag is false we will look for a view template with or without the subtemplate defined in getViewTemplateUris. If it's true we will only look for the subtemplate specified.
public isStrictTpl ( ) : boolean
Результат boolean

isStrictView() публичный Метод

Returns the "strict view" flag. When the flag is false we will look for the view template in both the singularised and pluralised view. If it's true we will only look for the view template in the view specified in getViewTemplateUris.
public isStrictView ( ) : boolean
Результат boolean

parseTemplateUri() публичный Метод

Parses a template URI in the form of admin:component/view/layout to an array listing the application section (admin, site), component, view and template referenced therein.
public parseTemplateUri ( string $uri = '' ) : array
$uri string The template path to parse
Результат array A hash array with the parsed path parts. Keys: admin, component, view, template

removeExtension() публичный Метод

Remove an extension from the list of view template extensions
public removeExtension ( string $extension ) : void
$extension string
Результат void

resolveUriToPath() публичный Метод

Resolves a view template URI (e.g. any:com_foobar/Items/cheese) to an absolute filesystem path (e.g. /var/www/html/administrator/components/com_foobar/View/Items/tmpl/cheese.php)
public resolveUriToPath ( string $uri, string $layoutTemplate = '', array $extraPaths = [] ) : string
$uri string The view template URI to parse
$layoutTemplate string The layout template override of the View class
$extraPaths array Any extra lookup paths where we'll be looking for this view template
Результат string

setDefaultLayout() публичный Метод

Sets the default layout name
public setDefaultLayout ( string $defaultLayout ) : void
$defaultLayout string
Результат void

setDefaultTpl() публичный Метод

Sets the default subtemplate name
public setDefaultTpl ( string $defaultTpl )
$defaultTpl string

setExtensions() публичный Метод

Set the list of view template extensions
public setExtensions ( array $extensions ) : void
$extensions array
Результат void

setSidePrefix() публичный Метод

Sets the application side prefix which will be used by default in getViewTemplateUris. It can be one of: site Public front-end admin Administrator back-end auto Automatically figure out if it should be site or admin any First look in the current application side, then look on the other side of the application
public setSidePrefix ( string $sidePrefix ) : void
$sidePrefix string
Результат void

setStrictLayout() публичный Метод

Sets the "strict layout" flag. When the flag is false we will look for a view template with both the specified and the default template name in getViewTemplateUris. When true we will only look for the specified view template.
public setStrictLayout ( boolean $strictLayout ) : void
$strictLayout boolean
Результат void

setStrictTpl() публичный Метод

Sets the "strict template" flag. When the flag is false we will look for a view template with or without the subtemplate defined in getViewTemplateUris. If it's true we will only look for the subtemplate specified.
public setStrictTpl ( boolean $strictTpl ) : void
$strictTpl boolean
Результат void

setStrictView() публичный Метод

Sets the "strict view" flag. When the flag is false we will look for the view template in both the singularised and pluralised view. If it's true we will only look for the view template in the view specified in getViewTemplateUris.
public setStrictView ( boolean $strictView ) : void
$strictView boolean
Результат void

Описание свойств

$container защищенное свойство

The container of the view, for quick reference
protected $container

$defaultLayout защищенное свойство

Default layout's name (default: "default")
protected $defaultLayout

$defaultTpl защищенное свойство

Default subtemplate name (default: empty)
protected $defaultTpl

$extensions защищенное свойство

The layout template extensions to look for
protected $extensions

$sidePrefix защищенное свойство

Which application side prefix should I use by default (site, admin, auto, any)
protected $sidePrefix

$strictLayout защищенное свойство

Should Should I only look for this layout or also the default layout?
protected $strictLayout

$strictTpl защищенное свойство

Should I only look for the defined subtemplate or also no subtemplate?
protected $strictTpl

$strictView защищенное свойство

Should I only look in the specified view (true) or also the pluralised/singularised (false)
protected $strictView

$view защищенное свойство

The view we are attached to
protected $view