aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2017-10-04 16:50:42 +0200
committerThomas Lange <code@nerdmind.de>2017-10-04 16:52:18 +0200
commit2a1d85fdd1a0fb256e46013bb4c64470ab0ec2fd (patch)
tree3073ac73b46ee09b9cdce99ccef146b0e38752b2
parentdc36b1efebbe2a7f8f73c66a8689c5aeaa97e4b9 (diff)
downloadbigpipe-2a1d85fdd1a0fb256e46013bb4c64470ab0ec2fd.tar.gz
bigpipe-2a1d85fdd1a0fb256e46013bb4c64470ab0ec2fd.tar.xz
bigpipe-2a1d85fdd1a0fb256e46013bb4c64470ab0ec2fd.zip
A new method called "getPriority" has been implemented, which returns the priority of the corresponding Pagelet instance.
-rwxr-xr-xinclude/classes/BigPipe/Pagelet.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/classes/BigPipe/Pagelet.php b/include/classes/BigPipe/Pagelet.php
index 42ea470..484a6e2 100755
--- a/include/classes/BigPipe/Pagelet.php
+++ b/include/classes/BigPipe/Pagelet.php
@@ -11,6 +11,7 @@ namespace BigPipe;
class Pagelet extends Item {
private $HTML = '';
private $JSCode = [];
+ private $priority = NULL;
private $resources = [];
private $dependencies = [];
private $tagname = 'div';
@@ -38,6 +39,7 @@ class Pagelet extends Item {
public function __construct($customID = NULL, $priority = self::PRIORITY_NORMAL) {
$this->ID = $customID ?? 'P'.++self::$count;
+ $this->priority = $priority;
$this->resources = array_pad($this->resources, 2, []);
$this->phaseDoneJS = array_pad($this->phaseDoneJS, 5, []);
@@ -45,6 +47,13 @@ class Pagelet extends Item {
}
#===============================================================================
+ # Return the priority
+ #===============================================================================
+ public function getPriority() {
+ return $this->priority;
+ }
+
+ #===============================================================================
# Return the HTML content
#===============================================================================
public function getHTML() {