forms in 1.0.0

42 views
Skip to first unread message

Alex

unread,
Mar 14, 2013, 6:25:37 PM3/14/13
to pha...@googlegroups.com
I'm trying to test fom component. There is my code:

$form = new \Phalcon\Forms\Form();
$field = new \Phalcon\Forms\Element\Text("name");
$field->addValidator(
                   new \Phalcon\Validation\Validator\PresenceOf(
                             array(
                                           'message' => 'The name is required'
                                      ) 
                   )
);
var_dump($field);
$form->add($field);


and output:

object(Phalcon\Forms\Element\Text)#2 (2) {
  ["_name":protected]=>
  string(4) "name"
  ["_validators":protected]=>
  NULL
}

it looks like validator can't be added and as result $form->isValid() always returns false.

Please advise.

Andres Gutierrez

unread,
Mar 14, 2013, 6:33:36 PM3/14/13
to pha...@googlegroups.com
Hi Alex, could you please compile 1.0.0 again? I added a fix for this yesterday

2013/3/14 Alex <carme...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Phalcon PHP Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phalcon+u...@googlegroups.com.
To post to this group, send email to pha...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/phalcon/-/JjAhok4de9IJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Alex

unread,
Mar 14, 2013, 7:42:06 PM3/14/13
to pha...@googlegroups.com, andres.g...@phalconphp.com
Thank you! Now it works as expected.
Reply all
Reply to author
Forward
0 new messages