Elgg  Version 2.3
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Elgg\ViewsService Class Reference

WARNING: API IN FLUX. More...

Public Member Functions

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

Public Attributes

const VIEW_HOOK = 'view'
 
const VIEW_VARS_HOOK = 'view_vars'
 
const OUTPUT_KEY = '__view_output'
 
 $view_path
 

Protected Member Functions

 fileExists ($path)
 Wrapper for file_exists() that caches false results (the stat cache only caches true results). More...
 

Protected Attributes

 $file_exists_cache = []
 

Detailed Description

WARNING: API IN FLUX.

DO NOT USE DIRECTLY.

Use the elgg_* versions instead.

private

Since
1.9.0

Definition at line 17 of file ViewsService.php.

Constructor & Destructor Documentation

Elgg\ViewsService::__construct ( PluginHooksService  $hooks,
Logger  $logger 
)

Constructor.

Parameters
PluginHooksService$hooksThe hooks service
Logger$loggerLogger

Definition at line 88 of file ViewsService.php.

Member Function Documentation

Elgg\ViewsService::autoregisterViews (   $view_base,
  $folder,
  $viewtype 
)

private

Definition at line 128 of file ViewsService.php.

Elgg\ViewsService::cacheConfiguration ( SystemCache  $cache)

Cache the configuration.

Parameters
SystemCache$cacheThe system cache
Returns
void private

Definition at line 674 of file ViewsService.php.

Elgg\ViewsService::canonicalizeViewName (   $alias)

Takes a view name and returns the canonical name for that view.

Parameters
string$aliasThe possibly non-canonical view name.
Returns
string The canonical view name.

Definition at line 100 of file ViewsService.php.

Elgg\ViewsService::configureFromCache ( SystemCache  $cache)

Configure locations from the cache.

Parameters
SystemCache$cacheThe system cache
Returns
bool private

Definition at line 651 of file ViewsService.php.

Elgg\ViewsService::doesViewtypeFallback (   $viewtype)

private

Definition at line 217 of file ViewsService.php.

Elgg\ViewsService::extendView (   $view,
  $view_extension,
  $priority = 501 
)

private

Definition at line 422 of file ViewsService.php.

Elgg\ViewsService::fileExists (   $path)
protected

Wrapper for file_exists() that caches false results (the stat cache only caches true results).

This saves us from many unneeded file stat calls when a common view uses a fallback.

Parameters
string$pathPath to the file
Returns
bool

Definition at line 340 of file ViewsService.php.

Elgg\ViewsService::findViewFile (   $view,
  $viewtype 
)

Find the view file.

Parameters
string$viewView name
string$viewtypeViewtype
Returns
string Empty string if not found private

Definition at line 171 of file ViewsService.php.

Elgg\ViewsService::getInspectorData ( )

Get inspector data.

Returns
array

private

Definition at line 626 of file ViewsService.php.

Elgg\ViewsService::getViewList (   $view)

Get the views, including extensions, used to render a view.

Keys returned are view priorities. View existence is not checked.

Parameters
string$viewView name
Returns
string[] private

Definition at line 253 of file ViewsService.php.

Elgg\ViewsService::isCacheableView (   $view)

private

Definition at line 498 of file ViewsService.php.

Elgg\ViewsService::listViews (   $viewtype = 'default')

List all views in a viewtype.

Parameters
string$viewtypeViewtype
Returns
string[]

private

Definition at line 612 of file ViewsService.php.

Elgg\ViewsService::mergeViewsSpec ( array  $spec)

Merge a specification of absolute view paths.

Parameters
array$specSpecification viewtype => [ view_name => path or array of paths ]

private

Definition at line 577 of file ViewsService.php.

Elgg\ViewsService::registerCacheableView (   $view)

private

Definition at line 489 of file ViewsService.php.

Elgg\ViewsService::registerPluginViews (   $path,
$failed_dir = '' 
)

Register a plugin's views.

Parameters
string$pathBase path of the plugin
string$failed_dirThis var is set to the failed directory if registration fails
Returns
bool

private

Definition at line 535 of file ViewsService.php.

Elgg\ViewsService::registerViewtypeFallback (   $viewtype)

private

Definition at line 210 of file ViewsService.php.

Elgg\ViewsService::renderDeprecatedView (   $view,
array  $vars,
  $suggestion,
  $version 
)

Display a view with a deprecation notice.

No missing view NOTICE is logged

See also
elgg_view()
Parameters
string$viewThe name and location of the view to use
array$varsVariables to pass to the view
string$suggestionSuggestion with the deprecation message
string$versionHuman-readable release version: 1.7, 1.8, ...
Returns
string The parsed view private

Definition at line 234 of file ViewsService.php.

Elgg\ViewsService::renderView (   $view,
array  $vars = [],
  $ignored = false,
  $viewtype = '',
  $issue_missing_notice = true 
)

private

Definition at line 264 of file ViewsService.php.

Elgg\ViewsService::setViewDir (   $view,
  $location,
  $viewtype = '' 
)
Parameters
string$viewName of the view
string$locationFull path to the view file
string$viewtypeThe viewtype to register this under

private

Definition at line 191 of file ViewsService.php.

Elgg\ViewsService::unextendView (   $view,
  $view_extension 
)

private

Definition at line 468 of file ViewsService.php.

Elgg\ViewsService::viewExists (   $view,
  $viewtype = '',
  $recurse = true 
)

private

Definition at line 381 of file ViewsService.php.

Elgg\ViewsService::viewHasHookHandlers (   $view)

Do hook handlers exist to modify the view?

Parameters
string$viewView name
Returns
bool

Definition at line 461 of file ViewsService.php.

Elgg\ViewsService::viewIsExtended (   $view)

Is the given view extended?

Parameters
string$viewView name
Returns
bool

Definition at line 448 of file ViewsService.php.

Member Data Documentation

Elgg\ViewsService::$file_exists_cache = []
protected

Definition at line 27 of file ViewsService.php.

Elgg\ViewsService::$view_path

Definition at line 80 of file ViewsService.php.

const Elgg\ViewsService::OUTPUT_KEY = '__view_output'

Definition at line 21 of file ViewsService.php.

const Elgg\ViewsService::VIEW_HOOK = 'view'

Definition at line 19 of file ViewsService.php.

const Elgg\ViewsService::VIEW_VARS_HOOK = 'view_vars'

Definition at line 20 of file ViewsService.php.


The documentation for this class was generated from the following file: