Question

In base PasswordResetRequestForm model:

public function rules()
    {
        return [               
            ['email', 'exist',
                'targetClass' => '\common\models\User',
                'filter' => ['status' => User::STATUS_ACTIVE],
                'message' => 'Such user is not registered. '.BaseHtml::a('Signup.',['site/signup'])
            ],
        ];
    }

But link renders encoded. How to force it not to be encoded? Where should I do it, in ActiveForm, in field config, or in validation rule?

Was it helpful?

Solution

I don't know about the past, but now you can configure it in the fieldConfig:

$form = ActiveForm::begin([
    'fieldConfig' => [
        'errorOptions' => ['encode' => false],
    ],
]);

OTHER TIPS

You can configure this on ActiveForm :

<?php $form = ActiveForm::begin([
    'encodeErrorSummary' => false,
]); ?>

Read more : http://www.yiiframework.com/doc-2.0/yii-widgets-activeform.html#$encodeErrorSummary-detail

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top