Elgg
Version 1.10
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
engine
classes
Elgg
Context.php
Go to the documentation of this file.
1
<?php
2
namespace
Elgg
;
3
27
final
class
Context
{
28
29
private
$stack = array();
30
36
public
function
peek
() {
37
$topPos = count($this->stack) - 1;
38
39
if
($topPos >= 0) {
40
return
$this->stack[$topPos];
41
}
else
{
42
return
NULL;
43
}
44
45
}
46
53
public
function
push
(
$context
) {
54
array_push($this->stack,
$context
);
55
}
56
62
public
function
pop
() {
63
return
array_pop($this->stack);
64
}
65
72
public
function
set
(
$context
) {
73
$context
= trim(
$context
);
74
75
if
(empty(
$context
)) {
76
return
false
;
77
}
78
79
$context
= strtolower(
$context
);
80
81
$this->pop();
82
$this->push(
$context
);
83
84
return
true
;
85
}
86
98
public
function
contains
(
$context
) {
99
return
in_array(
$context
, $this->stack);
100
}
101
}
Elgg\Context\peek
peek()
Get the most recently pushed context value.
Definition:
Context.php:36
$context
$context
Definition:
add.php:11
Elgg\Context\pop
pop()
Removes and returns the top context string from the stack.
Definition:
Context.php:62
Elgg\Context\contains
contains($context)
Check if this context exists anywhere in the stack.
Definition:
Context.php:98
Elgg\Context\push
push($context)
Push a context onto the top of the stack.
Definition:
Context.php:53
Elgg
Save menu items.
Elgg\Context
Definition:
Context.php:27
Generated on Fri May 2 2025 00:00:26 for Elgg by
1.8.11