voltrb

What is controller_group for in view call?


I just wanted to understand better the view call in main.hmtl: what is the third parameter {controller_group: 'main'} for in:

{{ view main_path, "title", {controller_group: 'main'} }} 

Are there other options or parameters that can be passed to view? Sorry if I've missed something in the docs.


Solution

  • controller_group makes it so multiple view bindings can share the same controller instance. You give it a unique string name between each view binding and it will only load up one. Otherwise each view (title and body for example) would get its own controller.