I have a form, and need the field type in the bindrequest, the method getType dont works fine:
$peticion = $this->getRequest();
if ($peticion->getMethod() == 'POST')
{
$form->bindRequest($peticion);
if ($form->isValid()) {
foreach($form as $key => $per)
$per->getType(); // i want the type of item [text,checkbox,etc] the method getType() dont work
}}
Use this:
foreach($form as $key => $per) {
$per->getConfig()->getType()->getName();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With