At the moment, there is no set of practices/concepts that guide the way UI controls are coded. The general process to add one seems to be:
1) Add controller action that echo's HTML via a template.
1) Create a class for the control server side that derives from a UIControl base (which in turn derives from Piwik\View).
2) Define properties (as are done currently for ViewDataTable) to allow PHP code to configure the UIControl & create a template that uses those properties.
3) Create a controller action that echos the control.
Would the value be for core devs, or would this improvement also help plugin developers?
In 94799537f84f0be7a3ad2da3bf289ed2783c3b27: Refs #4116, move initElements code to utility function in UIControl.
See ticket AngularJS in Piwik #4691