Reputation: 1118
I have my application controllers configured with namespace as following:
use yii\helpers\Html;
When i try to access the Html class within the view: I get an exception, and have to re-declare the use statement.
Can i share the controller / view namespace?
Upvotes: 0
Views: 238
Reputation: 1981
Controllers and views are differrent parts of your application. So you should declare use
s in both controllers and views. This is not a bug, it's a common practice.
Upvotes: 1