I don’t know if I’m posting in the right section, but I’m testing PHx on my modx installation, and I’d like to know which code will be parsed faster (I’m a little curious and moreover, with a low performance machine :s)
Either PHx :
[*thispageimage:ne=``:then=`<img src="assets/images/pages/[*thispageimage*]" alt="This Page image" width="114px" height="114px" class="left" border="none" />`*]
Or a cached snippet :
$tv = $modx->getTemplateVar('thispageimage',"", $modx->documentIdentifier);
if($tv['value']!='')
{
return '<img src="assets/images/pages/'.$tv[value].' " alt="This Page image" width="114px" height="114px" class="left" border="none" />';
}
in my template...
Does it change something for a page not in cache ? (The little timing tests I’ve done show a little advantage for the cached snippet. Why ?...)