The wrapper file is the main browser-side template behavior handler. It handles events and builds the basic logic of the template's behavior.
The wrapper file is easier to create either using the SublimeFCFPlugin, VSCodeFCFFramework plugins or the command:
Where:
TEMPLATE_NAME - Name of the new template
SUPER_TEMPLATE - The path to the base template from which the new template will inherit. Optional parameter
Example template :templates/pages/template.tmpl
Example wrapper file for a template :templates/pages/template.tmpl
As a result, when you click on the link described in the template, the onClick () method will be called
As you can see from the example, the wrapper file is an FCF module that exports the wrapper class. All wrapper classes must inherit from the base class
More details about the class methods can be found at the link:
Declaring a wrapper for a subtemplate is similar to declaring a regular wrapper, only the name of the subtemplate is added to the template name through the + sign.
Example:
Template :templates/pages/template.tmpl containing the item sub-template
You can create it with the command:
File :templates/pages/template+item.wrapper.js
The wrapper for item will have a filename :templates/pages/template+item.wrapper.js