You could make that a helper, and include it in your BaseController, then it's available within all views.
Just a note: The $this context refers to the sytsem's View class, not the controller.
Just a note: The $this context refers to the sytsem's View class, not the controller.