2

I have a translatable string in common/messages/en-Us/frontend/quicksignup as:

return [
    'AcceptTermsAndConditionLabel' => 'I confirm that I am more than 13 years old and accept the {terms and condition}, and {privacy policy} of this website',
];

My QuickSignupForm model looks like:

public function attributeLabels()
{
     return [
        'AcceptTermsAndCondition'   => Yii::t('frontend/quicksignup','AcceptTermsAndConditionLabel'),

     ];
}

It render the following content:

I confirm that I am more than 13 years old and accept the {terms and condition}, and {privacy policy} of this website

I want to replace the {terms and condition}and {privacy policy}with the links. But when I try to do that in my translatable file i.e common/messages/en-Us/frontend/quicksignup it gets rendered as a string.

Below is the screenshot of the output. How can I render the links? Any ideas?

enter image description here

Chinmay Waghmare
  • 5,368
  • 2
  • 43
  • 68

1 Answers1

2

I find solution. Use label method in ActiveField and set format=>raw option. Code like this:

<?= $form->field($model, 'rememberMe')->checkbox()->label(Yii::t('app', 'I confirm that I am more than 13 years old and accept the {terms and condition}, and {privacy policy} of this website', ['privacy policy'=>
        Html::a('111', '/asd/')]), ['format' => 'raw']) ?>

This solution have one minus. You must set label twice: in model and in form.

vitalik_74
  • 4,573
  • 2
  • 19
  • 27