M
M
Mikha Pankratov2016-04-07 11:27:35
Yii
Mikha Pankratov, 2016-04-07 11:27:35

How to set up a template in yii2?

Good afternoon,
I will go straight to the question.
The fact is that when setting up our template, we use {error}{label} - which, in turn, still drag their classes and tags, how to change them?
I'm talking about them)

<p class="help-block help-block-error">Your Email cannot be blank.</p>
<label class="col-sm-2 control-label" for="signupform-email">Your Email</label>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2016-04-07
@webinar

what is the template for? activeform?
If yes, then there are several options:
1. Form inputs bypassing activeform
2. Create your own class inherited from activeform and redefine everything there as you like
3. Specify errorCssClass, fieldClass, etc. in the form widget. Details here: www.yiiframework.com/doc-2.0/yii-widgets-activefor...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question