burnbright/silverstripe-termsandconditionscheckboxfield

Terms and conditions checkbox field for SilverStripe

dev-master 2017-04-02 05:51 UTC

This package is auto-updated.

Last update: 2024-10-24 19:26:06 UTC


README

A checkbox field (with optional page link) that must be checked for form validation to succeed.

Usage

// when building a Form's fields
$fields->push(
	TermsAndConditionsCheckboxField::create()
		->setTermsPage(SiteTree::get_by_link("terms-and-conditions"));
);

Customise message

Either set the field's Title, or update lang file:

en:
  TermsAndConditionsCheckboxField:
    PageLinkContent: "I agree to the <a href=\"{TermsPageLink}\" target=\"new\" title=\"Read the terms and conditions for this site\">{TermsPageTitle}</a>."