Archived
1
0
Fork 0

initial commit

This commit is contained in:
Henrik Hautakoski 2017-09-01 17:10:27 +02:00
commit e869a1cab4
107 changed files with 9029 additions and 0 deletions

View file

@ -0,0 +1,43 @@
<?php
namespace Form;
use Phalcon\Forms\Form;
/**
* Element types
*/
use Phalcon\Forms\Element\Text;
use Phalcon\Forms\Element\Submit;
/**
* Validators
*/
use Phalcon\Validation\Validator\StringLength;
class CallbackCreate extends Form
{
public function initialize()
{
$this->setEntity($this);
// Name
$name = new Text('Name', array(
'class' => 'form-control',
));
$validator = new StringLength([
'max' => 50,
'min' => 2,
'messageMaximum' => 'Must be less than :max characters.',
'messageMinimum' => 'Must be atleast :min characters long.'
]);
$name->addValidator($validator);
$this->add($name);
// Submit
$submit = new Submit('Create', array('class' => 'button button-brand'));
$this->add($submit);
}
}