diff options
author | Thomas Lange <code@nerdmind.de> | 2016-10-22 01:08:22 +0200 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2016-10-22 01:08:22 +0200 |
commit | 19c0af6809b8db0b763565fa9b273c90da3d1894 (patch) | |
tree | 9abe45611cb8bc90ab9f91f84309e65e8b9e08ce /include/pagelets.php | |
parent | 842379e0ca399bdb5f8b85c455d1136b519d1816 (diff) | |
download | bigpipe-19c0af6809b8db0b763565fa9b273c90da3d1894.tar.gz bigpipe-19c0af6809b8db0b763565fa9b273c90da3d1894.tar.xz bigpipe-19c0af6809b8db0b763565fa9b273c90da3d1894.zip |
The Pagelet representation class in PHP now has a separate method to add dependencies (either with the instance of the dependency Pagelet or the unique ID as string as argument).
Diffstat (limited to 'include/pagelets.php')
-rw-r--r-- | include/pagelets.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/pagelets.php b/include/pagelets.php index 9725879..4a86d49 100644 --- a/include/pagelets.php +++ b/include/pagelets.php @@ -33,7 +33,7 @@ $PageletGreen = new BigPipe\Pagelet('greenPL'); #=============================================================================== # Pagelet within $PageletGreen #=============================================================================== - // The third parameter is required to ensure that the $InnerPagelet will only be + // The addDependency call is required to ensure that $InnerPagelet will only be // executed if the HTML from the $PageletGreen has ALREADY DISPLAYED. Otherwise, // $InnerPagelet would not find his placeholder tag which is defined WITHIN the // HTML on $PageletGreen. Of course, you can still add other pagelets as @@ -44,7 +44,12 @@ $PageletGreen = new BigPipe\Pagelet('greenPL'); // the first which arrives, but it will first be displayed if his dependency // pagelets are already displayed. - $InnerPagelet = new BigPipe\Pagelet('innerPL', BigPipe\Pagelet::PRIORITY_HIGHEST, [$PageletGreen->getID()]); + $InnerPagelet = new BigPipe\Pagelet('innerPL', BigPipe\Pagelet::PRIORITY_HIGHEST); + + // NOTICE: You can also use the Pagelet ID (as string) as argument. May be helpful + // if a dependency Pagelet object is not accessible within the current scope. + $InnerPagelet->addDependency($PageletGreen); + $InnerPagelet->addHTML('<section sytle="background:#FFF;padding:5px;">Inner Pagelet \(o_o)/</section>'); } |