autoload preferences

The $prefer{} directive is a declaration of autoload preferences, from within a template. Only one per template is allowed.

When template is fetched on the fly e.g. when evoque'd from another template, it may either have already been loaded, compiled, and cached or it may still need to be looked up and compiled -- in this latter case all parameters that may affect how the template is compiled are needed. Precisely for such a case, the $prefer{} directive provides the convenience of specifying default parameter values that will be used if corresponding values are not specified when the template is loaded.

Parameters

The parameters are a subset of those of the evoque directive. A parameter of the prefer directive is only taken into consideration if:

  • it has not been specified at template load time;
  • the preferred value is different than the cascaded default value from the collection.
$prefer{ raw=False, data=None, quoting="xml", filters=None } raw : may trigger template recompile data : may set value of template.data quoting : may trigger template recompile filters : may set value of template.filters

For details of each of these parameters, see the evoque directive page.