RichErrorSummary

uk.gov.hmrc.hmrcfrontend.views.implicits.RichErrorSummarySupport.RichErrorSummary
implicit class RichErrorSummary[T](errorSummary: ErrorSummary)(implicit val messages: Messages)

Extension methods to hydrate an ErrorSummary with the errors found in a Play form.

Error messages are hyperlinked to the HTML input elements corresponding to the Play field. For situations where the form field does not correspond to an HTML input element, for example, a composite field such as a date, provide a mapping from the composite field to Play field corresponding to the first HTML input element in the group.

For example:

 @govukErrorSummary(ErrorSummary().withFormErrorsAsText(dateInputForm, mapping = Map("date" -> "date.day")))

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def withFormErrorsAsHtml(form: Form[T]): ErrorSummary
def withFormErrorsAsHtml(form: Form[T], mapping: Map[String, String]): ErrorSummary
def withFormErrorsAsText(form: Form[T]): ErrorSummary
def withFormErrorsAsText(form: Form[T], mapping: Map[String, String]): ErrorSummary

Implicits

Implicits

implicit val messages: Messages