How do data-tpl and data-view behaviors work in Composr's JavaScript?

  • By
  • Added
  • 1 view
Question How do data-tpl and data-view behaviors work in Composr's JavaScript?
Answer Composr uses data-tpl and data-view behaviors for associating HTML templates and JavaScript views, respectively. This facilitates clean separation of presentation and logic:
  • data-tpl: Used with the $cms.behaviors.initializeTemplates function and PARAMS_JSON tempcode directive to bind JavaScript logic to HTML templates.
  • data-view: Used with the $cms.behaviors.initializeViews function to associate JavaScript view classes (inheriting from $cms.View) with specific HTML elements.

Rating

Unrated