Skip to content

Instantly share code, notes, and snippets.



Last active Oct 5, 2017
What would you like to do?
class User extends \atk4\data\Model
    function init() {

$form = $app->add(['Form', 'segment']);
$form->setModel(new User($db), ['email', 'password']);
$form->addField('is_accept_terms', null, ['type'=>'boolean']);
$form->onSubmit(function ($form) {
if (!$form->model['is_accept_terms']) {
return $form->error('is_accept_terms', 'Please accept terms');
return $form->success('Thank you');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.