I would like to check if there are blank embedded forms into my form, and delete the old ones from my database, and unset the new ones, so the validators don’t consider them….
what I’m doing is to unset() the forms i don’t want to consider,, but I was wondering if there is any better symfonian way to do it… I’ve seen the code of sfForm.class.php, but didn’t find a method just the opposite to embbedForm()
Any ideas? do I have to use unset()?
Use it without worries.
Just like you did to unset form fields in the older symfony versions (fx
unset($this['name']). Newer versions have introduced a methoduseFields($array), but you can still use theunsetfunction.As you can see here here, you can use it to unset an array element. And symfony’s
sfFormimplements ArrayAccess.