[symfony-users] Re: Request data not found by getParameter unless square brackets used in form name format

2009-09-13 Thread Gábor Fási

If you use the square brackets, your php script gets the submitted
data in an array, so $request->getParameter("search") also returns an
array, the same format you need for a form's bind() call. Besides
using these brackets, the only alternative way you have is to create
the array for the bind manually, as you said.

Gábor


On Sat, Sep 12, 2009 at 01:46, Jonathan Dart  wrote:
> If I change the name format to something like 'search__%s'
> getParameter doesn't find the request data. If I want to pass the data
> to bind I need to create an array by hand from the request (as far as
> I know).
>
> Is there some way to have getParameter work without using square
> brackets in the name format?
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[symfony-users] Re: Request data not found by getParameter unless square brackets used in form name format

2009-09-12 Thread Dennis

I would be very interested to hear the answer to this. From what I
have observed, the format of a very simple application

is 'table_alias_in_sql_statement[column_in_table]'. If there are other
ways that variables are put into forms, I'd like to know.

On Sep 11, 4:46 pm, Jonathan Dart  wrote:
> I have a form like so:
> class SearchForm extends sfForm {
>   public function configure() {
>     ...
>     $this->widgetSchema->setNameFormat('search[%s]');
>     ...
>
> and an action like so:
> ...
> public function executeSearch(sfWebRequest $request)
> {
>   $form = new SearchForm();
>   $form->bind($request->getParameter($form->getName()));}
>
> ...
>
> If I change the name format to something like 'search__%s'
> getParameter doesn't find the request data. If I want to pass the data
> to bind I need to create an array by hand from the request (as far as
> I know).
>
> Is there some way to have getParameter work without using square
> brackets in the name format?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---