Form checkbox

Hello How can i set a value on checkbox in the form? Phalcon\Forms\Element\Check 1.At the moment i just setup a checkbox, but the value that renders is "On", aand i want to be some integer like 1 or 0 2.The checkbox is not required ,so whats supposed to do in the model when validate ?



79
edited Oct '14
$rememberMe = new Check('remember_me', array(
    'value' => 1,
    'class' => 'box'
));
$this->add($rememberMe);

when you create a new form element you can pass it attributes as array.

http://docs.phalconphp.com/en/latest/api/Phalcon%5Forms%5Element%5Check.html

if you don't know how to make form class, check vokuro project

https://github.com/phalcon/vokuro/tree/master/app/forms