aboutsummaryrefslogtreecommitdiffstats
path: root/template/admin
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2017-05-05 02:38:39 +0200
committerThomas Lange <code@nerdmind.de>2017-05-05 02:38:39 +0200
commit796ea918866c15f0d59ce178d095022edfaf096d (patch)
treeae2891847e9371921b9834f727c0bd9cd2be42f6 /template/admin
parent5b3e9c5b10d08d94b05b2afc38196eded71c7781 (diff)
downloadblog-796ea918866c15f0d59ce178d095022edfaf096d.tar.gz
blog-796ea918866c15f0d59ce178d095022edfaf096d.tar.xz
blog-796ea918866c15f0d59ce178d095022edfaf096d.zip
A significant increase in the response time has been achieved, since the template parameters "$ITEM['BODY']['TEXT']" and "$ITEM['BODY']['HTML']" are now no longer strings but closures (anonymous functions). This means that the underlying logic, which parses the content or converts it into Markdown, is not executed until one of these parameters is really needed and called in the template (which maybe significantly increases the response time on a long list of items which not use one of those two parameters).v2.1
This means that within templates you now have to call these parameters in the following way (note the brackets at the end, which represent a function call): <?=$ITEM['BODY']['TEXT']()?> <?=$ITEM['BODY']['HTML']()?> In the background, the anonymous functions are called and executes $Item->getBody() and $Item->getHTML() only when needed. Previously, $Item->getBody() and $Item->getHTML() were basically executed and the parsed content was passed to the template, regardless of whether these parameters are required in the template or not!
Diffstat (limited to 'template/admin')
-rw-r--r--template/admin/html/page/item.php2
-rw-r--r--template/admin/html/post/item.php2
-rw-r--r--template/admin/html/user/item.php2
3 files changed, 3 insertions, 3 deletions
diff --git a/template/admin/html/page/item.php b/template/admin/html/page/item.php
index a19afa9..599e942 100644
--- a/template/admin/html/page/item.php
+++ b/template/admin/html/page/item.php
@@ -7,7 +7,7 @@
</div>
</header>
<blockquote cite="<?=$PAGE['URL']?>">
- <p><?=excerpt($PAGE['BODY']['HTML'])?></p>
+ <p><?=excerpt($PAGE['BODY']['HTML']())?></p>
</blockquote>
<?php if($PAGE['ARGV']): ?>
diff --git a/template/admin/html/post/item.php b/template/admin/html/post/item.php
index 750b03d..abc2b0f 100644
--- a/template/admin/html/post/item.php
+++ b/template/admin/html/post/item.php
@@ -7,7 +7,7 @@
</div>
</header>
<blockquote cite="<?=$POST['URL']?>">
- <p><?=excerpt($POST['BODY']['HTML'])?></p>
+ <p><?=excerpt($POST['BODY']['HTML']())?></p>
</blockquote>
<?php if($POST['ARGV']): ?>
diff --git a/template/admin/html/user/item.php b/template/admin/html/user/item.php
index 439916e..731f6b5 100644
--- a/template/admin/html/user/item.php
+++ b/template/admin/html/user/item.php
@@ -6,7 +6,7 @@
</div>
</header>
<blockquote cite="<?=$USER['URL']?>">
- <p><?=excerpt($USER['BODY']['HTML'])?></p>
+ <p><?=excerpt($USER['BODY']['HTML']())?></p>
</blockquote>
<?php if($USER['ARGV']): ?>