Hi Hari,

you can check how is it done in Silex:

https://github.com/fabpot/Silex/blob/master/src/Silex/Provider/FormServiceProvider.php

The controller method createFormBuilder translates to

    public function createFormBuilder($data = null, array $options = array())
    {
        return $this->container->get('form.factory')->createBuilder('form',
$data, $options);
    }


I guess you will also need to handle form binding yourself as you wont have
the right Request object.

    public function bindRequest(Request $request)
    {
        // Store the bound data in case of a post request
        switch ($request->getMethod()) {
            case 'POST':
            case 'PUT':
                $data = array_replace_recursive(
                    $request->request->get($this->getName(), array()),
                    $request->files->get($this->getName(), array())
                );
                break;
            case 'GET':
                $data = $request->query->get($this->getName(), array());
                break;
            default:
                throw new FormException(sprintf('The request method
"%s" is not supported', $request->getMethod()));
        }

        return $this->bind($data);
    }


Hope that helps
Cheers

On Thu, Dec 1, 2011 at 8:36 PM, Hari K T <kthar...@gmail.com> wrote:

> Hi Guys ,
>
> I downloaded the Symfony2 Form components .
> I was looking how to create the form object .
> Is it the FormFactory , FormBuilder or anything else ?
>
> I looked the book
>
>
> http://symfony.com/doc/current/book/forms.html#book-form-creating-form-classes
>
> But its mainly on the Symfony controller .
>
> I guess I want to pass the Event Dispatcher Object , Validator Object etc
> to the Form object when creation ....
>
> But I am not sure where the entry point to the form is ......
>
> Wondering , so if someone can show me the right path , it may help me to
> go easily .
>
> Thanks
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to