From 2a1d85fdd1a0fb256e46013bb4c64470ab0ec2fd Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Wed, 4 Oct 2017 16:50:42 +0200 Subject: A new method called "getPriority" has been implemented, which returns the priority of the corresponding Pagelet instance. --- include/classes/BigPipe/Pagelet.php | 9 +++++++++ 1 file changed, 9 insertions(+) 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,12 +39,20 @@ 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, []); BigPipe::addPagelet($this, $priority); } + #=============================================================================== + # Return the priority + #=============================================================================== + public function getPriority() { + return $this->priority; + } + #=============================================================================== # Return the HTML content #=============================================================================== -- cgit v1.2.3