<title>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).</title>
<updated>2017-05-05T00:38:39+00:00</updated>
<author>
<name>Thomas Lange</name>
<email>code@nerdmind.de</email>
...</author>
<published>2017-05-05T00:38:39+00:00</published>
<link rel="alternate" type="text/html" href="http://code.nerdmind.de/blog/commit/?id=796ea918866c15f0d59ce178d095022edfaf096d"/>
<id>urn:sha1:796ea918866c15f0d59ce178d095022edfaf096d</id>
<content type="text">
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!
</content>