3
我有一个表格,并需要在bindrequest字段类型项目类型,方法GetType不要工作得很好:Symfony2中得到形式
$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
}}
谢谢,非常漂亮 –