Elgg  Version 4.x
context.php
Go to the documentation of this file.
1 <?php
30  return _elgg_services()->request->getContextStack()->set($context);
31 }
32 
41 function elgg_get_context() {
42  return _elgg_services()->request->getContextStack()->peek();
43 }
44 
53  _elgg_services()->request->getContextStack()->push($context);
54 }
55 
62 function elgg_pop_context() {
63  return _elgg_services()->request->getContextStack()->pop();
64 }
65 
79  return _elgg_services()->request->getContextStack()->contains($context);
80 }
81 
89  return _elgg_services()->request->getContextStack()->toArray();
90 }
91 
99 function elgg_set_context_stack(array $stack) {
100  _elgg_services()->request->getContextStack()->fromArray($stack);
101 }
elgg_set_context($context)
Elgg context library.
Definition: context.php:29
$context
Definition: add.php:8
elgg_push_context($context)
Push a context onto the top of the stack.
Definition: context.php:52
elgg_set_context_stack(array $stack)
Set the entire context stack.
Definition: context.php:99
elgg_get_context()
Get the current context.
Definition: context.php:41
elgg_pop_context()
Removes and returns the top context string from the stack.
Definition: context.php:62
elgg_in_context($context)
Check if this context exists anywhere in the stack.
Definition: context.php:78
_elgg_services()
Get the global service provider.
Definition: elgglib.php:777
elgg_get_context_stack()
Get the entire context stack (e.g.
Definition: context.php:88