How to call the controller in the template

edited Nov '15

It is a bad idea. According to pattern, View nothing should know about Controller.



1.4k

How to create a widget that can be used in different places without passing a variable,

Why you even wanna do that ? Use some service/helper or partial view.



46.9k

You can extend the View class and have it automatically pass in variables that are applicable through the system. In my case I like to have DEV and ENV available.