keeg
keeg

Reputation: 3978

How to get module base url in yii2?

in Yii classic you would do something like this:

Yii::app()->getModule('moduleName')->getBaseUrl();

but I'm not sure how you get the base url in Yii2

Upvotes: 2

Views: 1623

Answers (1)

ScaisEdge
ScaisEdge

Reputation: 133360

Should be

\Yii::$app->getModule('moduleName')->basePath;

Upvotes: 1

Related Questions