2017 © Pedro Peláez
 

library confirmation-field

ConfirmationField is a form field for Atk14 applications. It's like the BooleanField (checkbox) but the ConfirmationField must be ticked.

image

atk14/confirmation-field

ConfirmationField is a form field for Atk14 applications. It's like the BooleanField (checkbox) but the ConfirmationField must be ticked.

  • Monday, September 4, 2017
  • by yarri
  • Repository
  • 2 Watchers
  • 0 Stars
  • 441 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 287 % Grown

The README.md

ConfirmationField

ConfirmationField is a form field for ATK14 applications. It's like the BooleanField (checkbox) but the ConfirmationField must be ticked., (*1)

It is the right field for an agreement with terms and conditions in your applications., (*2)

Installation

Just use the Composer:, (*3)

cd path/to/your/atk14/project/
composer require atk14/confirmation-field

Optionally you can create a symlink from vendor to your app:, (*4)

ln -s ../../vendor/atk14/confirmation-field/src/confirmation_field.php app/fields/confirmation_field.php

Usage

In a form:, (*5)

<?php
// file: app/forms/orders/create_new_form.php
class CreateNewForm extends ApplicationForm {

  function set_up(){

    // fileds...

    $this->add_field("confirmation", new ConfirmationField([
      "label" => _("I agree with terms and conditions"),
    ]))->update_message("required","You have to agree with terms and conditions");
  }

  function clean(){
    list($err,$data) = parent::clean();

    // usually it's not required to have the confirmation in the cleaned data
    unset($data["confirmation"]);

    return [$err,$data];
  }
}

License

ConfirmationField is free software distributed under the terms of the MIT license, (*6)

The Versions

04/09 2017

dev-master

9999999-dev https://github.com/atk14/ConfirmationField

ConfirmationField is a form field for Atk14 applications. It's like the BooleanField (checkbox) but the ConfirmationField must be ticked.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

field forms confirmation atk14