Accessing module messages inside layouts\main.php file

hi, I’m looking for a way to access translation source from my module in layouts\main.php file. Is it possible?

Ok I’ve achieved it by putting this line in the main app views/layouts/main.php:


Yii::app()->getModule($module->name)->label;

"label" is WysiwygModule instance getter which looks like this:


public function getLabel()

{

	return Yii::t('WysiwygModule.translation', 'Wysiwyg');

}

1 Like