0
ändern müssen Standard YII Fehler ZusammengefasstWie YII defualt Fehler Zusammenfassung einzelner Fehler
Um zu zeigen, jeden Fehler insbesondere Formularfeld als Bild unten anpassen.
Hier ist meine worklet Eigenschaften().
public function properties() {
return array(
'action' => url('/user/signup', array('dialog' => isset($_GET['dialog']) ? $_GET['dialog'] : 0)),
'elements' => array(
'firstName' => array('type' => 'text'),
'lastName' => array('type' => 'text'),
'email' => array('type' => 'text'),
'password' => array('type' => 'password'),
'passwordRepeat' => array('type' => 'password'),
'profile' => wm()->get('user.profile.helper')->form(),
'<hr />',
'termsAgree' => array(
'type' => 'checkbox',
'layout' => "<fieldset>{input}\n{label}\n{hint}\n{error}</fieldset>",
'uncheckValue' => '',
'required' => false,
'afterLabel' => '',
),
),
'buttons' => array(
'submit' => array('type' => 'submit',
'id'=>'signUpButton',
'label' => $this->t('Sign Up')),
),
'model' => $this->model
);
}
Hier ist meine Regeln() für das Modell:
public function rules()
{
return array(
array('email, password, passwordRepeat, firstName, lastName', 'required'),
array('firstName, lastName, email', 'length', 'max' => 250),
array('email', 'email'),
array('email', 'unique', 'className' => 'MUser', 'message' => $this->t('This email is already in use.')),
array('password', 'length', 'min' => 6),
array('passwordRepeat', 'compare', 'compareAttribute'=>'password'),
array('termsAgree', 'required', 'message' => $this->t('You must be agree to our Terms of Use and Privacy Policy to join this site.'))
);
}
poste einige code bitte .. wir können dir nicht helfen ohne code – Blueblazer172
schau hier zum offiziellen [docu] (http://www.yiiframework.com/doc-2.0/guide-input-validation.html#validating- Eingabe) – Blueblazer172
Diese Frage ist für Yii1 oder Yii2? – scaisEdge