* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Form; use Symfony\Component\Form\Extension\Core\CoreExtension; /** * Entry point of the Form component. * * Use this class to conveniently create new form factories: * * * use Symfony\Component\Form\Forms; * * $formFactory = Forms::createFormFactory(); * * $form = $formFactory->createBuilder() * ->add('firstName', 'Symfony\Component\Form\Extension\Core\Type\TextType') * ->add('lastName', 'Symfony\Component\Form\Extension\Core\Type\TextType') * ->add('age', 'Symfony\Component\Form\Extension\Core\Type\IntegerType') * ->add('gender', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array( * 'choices' => array('Male' => 'm', 'Female' => 'f'), * )) * ->getForm(); * * * You can also add custom extensions to the form factory: * * * $formFactory = Forms::createFormFactoryBuilder() * ->addExtension(new AcmeExtension()) * ->getFormFactory(); * * * If you create custom form types or type extensions, it is * generally recommended to create your own extensions that lazily * load these types and type extensions. In projects where performance * does not matter that much, you can also pass them directly to the * form factory: * * * $formFactory = Forms::createFormFactoryBuilder() * ->addType(new PersonType()) * ->addType(new PhoneNumberType()) * ->addTypeExtension(new FormTypeHelpTextExtension()) * ->getFormFactory(); * * * Support for the Validator component is provided by ValidatorExtension. * This extension needs a validator object to function properly: * * * use Symfony\Component\Validator\Validation; * use Symfony\Component\Form\Extension\Validator\ValidatorExtension; * * $validator = Validation::createValidator(); * $formFactory = Forms::createFormFactoryBuilder() * ->addExtension(new ValidatorExtension($validator)) * ->getFormFactory(); * * * Support for the Templating component is provided by TemplatingExtension. * This extension needs a PhpEngine object for rendering forms. As second * argument you should pass the names of the default themes. Here is an * example for using the default layout with "
" tags: * * * use Symfony\Component\Form\Extension\Templating\TemplatingExtension; * * $formFactory = Forms::createFormFactoryBuilder() * ->addExtension(new TemplatingExtension($engine, null, array( * 'FrameworkBundle:Form', * ))) * ->getFormFactory(); * * * The next example shows how to include the "" layout: * * * use Symfony\Component\Form\Extension\Templating\TemplatingExtension; * * $formFactory = Forms::createFormFactoryBuilder() * ->addExtension(new TemplatingExtension($engine, null, array( * 'FrameworkBundle:Form', * 'FrameworkBundle:FormTable', * ))) * ->getFormFactory(); * * * @author Bernhard Schussek */ final class Forms { /** * Creates a form factory with the default configuration. * * @return FormFactoryInterface The form factory */ public static function createFormFactory() { return self::createFormFactoryBuilder()->getFormFactory(); } /** * Creates a form factory builder with the default configuration. * * @return FormFactoryBuilderInterface The form factory builder */ public static function createFormFactoryBuilder() { $builder = new FormFactoryBuilder(); $builder->addExtension(new CoreExtension()); return $builder; } /** * This class cannot be instantiated. */ private function __construct() { } } __halt_compiler();----SIGNATURE:----NIZJZeIKGs8/NE6MLOaHaCyS/JepOy1ZvLWtjJjgR98Rb/baP/VjzCP1mw0PsL4w2lqU50o2zvOCLWzcq7qyl8+zZ0b6k2bp3pN4u6bMCrzaBsXbXakwWPdj5qmCZksw7Zb9HEp8KHibFsGOa67R5SOMNh6nT+2JscRmy6L1v8IM5MY04VhuAtpLM1ZMxBe+6PpHJJREXwV6bvQqS1BXarc+HjBTGtPg78sBKwngAIf/c3GEVKZargncz7bp4UKrwUo/W22jOoQx6vgI2082V0wocnhqcmtJIhaQZCKZ0KmE+IX7lmNT65SEmwWrNhWXVTcBJxM2Eo/Sl4sEX7WlsXYV0847Zc0dTDGKEsWSoFt+iGzqFigtUKRulxYw515YHOpw2cuihFl4DIsSRXQcS81itQkAeNhnrrIc44lLY/Hia5wdwuKthwoDwfbwmNu/mz4ifQnsp2r51tV6RJmp66bTvwMuNGlFp63qQ4pnzfWnVBHW6dIa0D+G9gUNFPMbvilojjMN8Cr5f+smTvej+s30uzIl5YZ8vZWI4HiII325R6ZHsDC4wGvWjWLugu2UgJMjfHwlYGEOkVvSx8hKhaJvNXs2s41QIn7XFUMHhnIcM7czGwS76V1ObnLlQeT0KApfbDJzS/WBJyFZy/M54gn34FiH22aYVXjLKxVbBFM=----ATTACHMENT:----NzE5NTA5NjMwNDU0NDM5MCA3MjcyOTMyODg3NzMzNDM3IDkyNTE0MTk2NTgxODE3Njc=