Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
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...
 
 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'
 

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 83 of file ViewsService.php.

Member Function Documentation

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

private

Definition at line 123 of file ViewsService.php.

Elgg\ViewsService::cacheConfiguration ( SystemCache  $cache)

Cache the configuration.

Parameters
SystemCache$cacheThe system cache
Returns
void private

Definition at line 665 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 95 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 642 of file ViewsService.php.

Elgg\ViewsService::doesViewtypeFallback (   $viewtype)

private

Definition at line 212 of file ViewsService.php.

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

private

Definition at line 413 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 334 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 166 of file ViewsService.php.

Elgg\ViewsService::getInspectorData ( )

Get inspector data.

Returns
array

private

Definition at line 617 of file ViewsService.php.

Elgg\ViewsService::isCacheableView (   $view)

private

Definition at line 489 of file ViewsService.php.

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

List all views in a viewtype.

Parameters
string$viewtypeViewtype
Returns
string[]

private

Definition at line 603 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 568 of file ViewsService.php.

Elgg\ViewsService::registerCacheableView (   $view)

private

Definition at line 480 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 526 of file ViewsService.php.

Elgg\ViewsService::registerViewtypeFallback (   $viewtype)

private

Definition at line 205 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 229 of file ViewsService.php.

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

private

Definition at line 258 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 186 of file ViewsService.php.

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

private

Definition at line 459 of file ViewsService.php.

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

private

Definition at line 372 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 452 of file ViewsService.php.

Elgg\ViewsService::viewIsExtended (   $view)

Is the given view extended?

Parameters
string$viewView name
Returns
bool

Definition at line 439 of file ViewsService.php.

Member Data Documentation

Elgg\ViewsService::$file_exists_cache = []
protected

Definition at line 27 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: