PHP Класс Elgg\ViewsService

Use the elgg_* versions instead.
С версии: 1.9.0
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$view_path Absolute path of the views directory

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

Свойство Тип Описание
$file_exists_cache array

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

Метод Описание
__construct ( PluginHooksService $hooks, Logger $logger ) Constructor
autoregisterViews ( $view_base, $folder, $viewtype )
cacheConfiguration ( SystemCache $cache ) : void Cache the configuration
canonicalizeViewName ( string $alias ) : string Takes a view name and returns the canonical name for that view.
configureFromCache ( SystemCache $cache ) : boolean Configure locations from the cache
doesViewtypeFallback ( $viewtype )
extendView ( $view, $view_extension, $priority = 501 )
findViewFile ( string $view, string $viewtype ) : string Find the view file
getInspectorData ( ) : array Get inspector data
getViewList ( string $view ) : string[] Get the views, including extensions, used to render a view
isCacheableView ( $view )
listViews ( string $viewtype = 'default' ) : string[] List all views in a viewtype
mergeViewsSpec ( array $spec ) Merge a specification of absolute view paths
registerCacheableView ( $view )
registerPluginViews ( string $path, string &$failed_dir = '' ) : boolean Register a plugin's views
registerViewtypeFallback ( $viewtype )
renderDeprecatedView ( string $view, array $vars, string $suggestion, string $version ) : string Display a view with a deprecation notice. No missing view NOTICE is logged
renderView ( $view, array $vars = [], $ignored = false, $viewtype = '', $issue_missing_notice = true )
setViewDir ( string $view, string $location, string $viewtype = '' )
unextendView ( $view, $view_extension )
viewExists ( $view, $viewtype = '', $recurse = true )
viewHasHookHandlers ( string $view ) : boolean Do hook handlers exist to modify the view?
viewIsExtended ( string $view ) : boolean Is the given view extended?

Защищенные методы

Метод Описание
fileExists ( string $path ) : boolean Wrapper for file_exists() that caches false results (the stat cache only caches true results).

Приватные методы

Метод Описание
renderViewFile ( string $view, array $vars, string $viewtype, boolean $issue_missing_notice ) : string | false Includes view PHP or static file
setViewLocation ( string $view, string $viewtype, string $path ) : void Update the location of a view file

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

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

Constructor
public __construct ( PluginHooksService $hooks, Logger $logger )
$hooks PluginHooksService The hooks service
$logger Logger Logger

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

public autoregisterViews ( $view_base, $folder, $viewtype )

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

Cache the configuration
public cacheConfiguration ( SystemCache $cache ) : void
$cache Elgg\Cache\SystemCache The system cache
Результат void

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

Takes a view name and returns the canonical name for that view.
public canonicalizeViewName ( string $alias ) : string
$alias string The possibly non-canonical view name.
Результат string The canonical view name.

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

Configure locations from the cache
public configureFromCache ( SystemCache $cache ) : boolean
$cache Elgg\Cache\SystemCache The system cache
Результат boolean

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

public doesViewtypeFallback ( $viewtype )

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

public extendView ( $view, $view_extension, $priority = 501 )

fileExists() защищенный Метод

This saves us from many unneeded file stat calls when a common view uses a fallback.
protected fileExists ( string $path ) : boolean
$path string Path to the file
Результат boolean

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

Find the view file
public findViewFile ( string $view, string $viewtype ) : string
$view string View name
$viewtype string Viewtype
Результат string Empty string if not found

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

Get inspector data
public getInspectorData ( ) : array
Результат array

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

Keys returned are view priorities. View existence is not checked.
public getViewList ( string $view ) : string[]
$view string View name
Результат string[]

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

public isCacheableView ( $view )

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

List all views in a viewtype
public listViews ( string $viewtype = 'default' ) : string[]
$viewtype string Viewtype
Результат string[]

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

Merge a specification of absolute view paths
public mergeViewsSpec ( array $spec )
$spec array Specification viewtype => [ view_name => path or array of paths ]

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

public registerCacheableView ( $view )

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

Register a plugin's views
public registerPluginViews ( string $path, string &$failed_dir = '' ) : boolean
$path string Base path of the plugin
$failed_dir string This var is set to the failed directory if registration fails
Результат boolean

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

public registerViewtypeFallback ( $viewtype )

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

Display a view with a deprecation notice. No missing view NOTICE is logged
См. также: elgg_view()
public renderDeprecatedView ( string $view, array $vars, string $suggestion, string $version ) : string
$view string The name and location of the view to use
$vars array Variables to pass to the view
$suggestion string Suggestion with the deprecation message
$version string Human-readable *release* version: 1.7, 1.8, ...
Результат string The parsed view

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

public renderView ( $view, array $vars = [], $ignored = false, $viewtype = '', $issue_missing_notice = true )
$vars array

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

public setViewDir ( string $view, string $location, string $viewtype = '' )
$view string Name of the view
$location string Full path to the view file
$viewtype string The viewtype to register this under

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

public unextendView ( $view, $view_extension )

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

public viewExists ( $view, $viewtype = '', $recurse = true )

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

Do hook handlers exist to modify the view?
public viewHasHookHandlers ( string $view ) : boolean
$view string View name
Результат boolean

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

Is the given view extended?
public viewIsExtended ( string $view ) : boolean
$view string View name
Результат boolean

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

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

См. также: fileExists
protected array $file_exists_cache
Результат array

$view_path публичное свойство

Absolute path of the views directory
public $view_path