burnbright/silverstripe-termsandconditionscheckboxfield

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Terms and conditions checkbox field for SilverStripe

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

This package is auto-updated.

Last update: 2021-10-24 12:59:22 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>."