php - How to set label for Yii2 Captcha widget? -


using yii2, realise template property captcha widget has {image} , {input} token. question is, how set {label} token via template property , move around, maybe want under {image} example?

i have tried following: (setting label inside field ordinary form field).

<?= $form->field($model, 'verifycode', ['template' => '{label}'])->widget(captcha::classname(), [     'template' => '<div class="col-xs-12">{image}</div><div class="col-xs-12">{input}</div>',     'options' => ['placeholder' => 'captcha code', 'class' => 'form-control'] ]) ?> 

thanks!!

<?= $form->field($model, 'captcha')->widget(\yii\captcha\captcha::classname(),['options' => [                      'placeholder' => 'please enter letters displayed above'                         , 'class' => 'form-control'                         , 'style' => 'top-margin: 10px;'                 ]])->label('security code')?> 

Comments