SilverCart\View\SCTemplateParser
Extends the original SSTemplateParser to provide a configuration property to disable the XML_val cache for field labels.
This is implemented to allow sending a shop email in multiple languages within a
single PHP runtime.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2020 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class SCTemplateParser
extends SSTemplateParser
{
- // members
- private static bool $disable_field_label_cache = false;
- private static array $disable_cache_for_properties = ;
- // methods
- public void Lookup_AddLookupStep()
Hierarchy
Extends
- SilverStripe\View\SSTemplateParser
Uses
- SilverStripe\Core\Config\Configurable
Members
private
- $disable_cache_for_properties
—
array
Add property names to this list to exclude them from template parser caching. - $disable_field_label_cache
—
SilverCart\View\bool
Disable the template parser cache for field labels by setting this configuration property to true.
Methods
public
- Lookup_AddLookupStep() — The basic generated PHP of LookupStep and LastLookupStep is the same, except that LookupStep calls 'obj' to get the next ViewableData in the sequence, and LastLookupStep calls different methods (XML_val, hasValue, obj) depending on the context the lookup is used in.