In the Contactform plugin page there's a code example that's confusing me.

Only the email and message are required in the code, but the fromName field does have an error syntax:

<input id="fromName" type="text" name="fromName" value="{% if message is defined %}{{ message.fromName }}{% endif %}">
{{ message is defined and message ? errorList(message.getErrors('fromName')) }}

What's the use of the getErrors here? I've tried using rare characters, but no errors?

1 Answer 1


In the ContactFormModel you can manage the attribute 'required' => true.

The example just show how to use the getErrors for each field.

You can delete the ones you dont need.

  • 1
    Thanks, just wanted to make sure about that. Since that attribute requires a hack in the plugin, I'd rather see only the supported errors...
    – noregt
    Commented Jan 20, 2015 at 20:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.