Can I create custom views that can do process logic before rendering the view? - Mach-II/Mach-II-Framework GitHub Wiki

Yes, you can do this by creating an filter that utilizes the DisplayView() method in the EventContext object. The built-in view-page command is merely a wrapper for the DisplayView() method. This allows you to still use pre-defined views from your configuration file as well as do some sort of pre-defined logic before rendering your output. An example of a filter could be building a simple display table from a passed in query object or a filter that waits for specific event args and pulls in pre-determined javascript packages to be consumed by a layout event.

Back to FAQs