2

How can I translate the property named Create NEW inside the link?

Html::a('Create NEW', ['create'], ['class' => 'btn btn-success']),

I tried this

$var = Yii::t('app', 'Create NEW');
Html::a($var, ['create'], ['class' => 'btn btn-success']);

but the link gets lost.

1 Answer 1

3

Yes, you can place the translation inside the link widget:

Html::a(Yii::t('app', 'Create NEW'), ['create'], ['class' => 'btn btn-success']),
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.