I have to agree, form helper sometimes just doesn't bring enough to
the table to make it worthwhile.

If you really insist on using the form helper you can modify the
template it uses for field names. so instead of doing data[%s][%s],
you can just do %s.

I would either (a) create your own helper and use a similar function

function input($name=null,$options=array())
{
 if($name != null)
 {
   echo '<input type="text" name="' . $name . '" ';
   foreach($options as $option=>$value)
   {
     echo "{$option}=\"{$value}\" ";
   }
   echo '>';
 }
}

$myHelper->input('name',array('style'=>'myStyle', 'size'=>'20');


Or, just modify cakes to suit your needs :0



On Feb 5, 12:57 am, boyracerr <[EMAIL PROTECTED]> wrote:
> Hello to all,
>
> I am trying to create a form which will pass an array style data
> structure through to the request via _GET.
>
> This should be of the format
>
> $search['variableName']=variableValue
>
> and might sometimes have arrays within the array, thus:
>
> $search['variableName'][] =variableValue1
>
> How can I achieve this? In the application I am converting, I was able
> to use:
>
> <input name=search[variableName]>
>
> in the HTML form, and the data would come through intact.
>
> However, now that I use in the view:
>
> <?php echo $form->input('search[variableName]', array('label' => ''));?
>
>
>
> This renders as:
>
> <input name="data[ControllerName][search[variableName]]">
>
> which seems to screw things up so that the resulting array is:
>
> Array
> (
>     [search[variableName] => variableValue
> )
>
> Obviously Cake is doing some escaping stuff that interferes here.
>
> Is there a way I can get around this? I would rather do it the
> 'proper' way using form->input than have to write it manually.
>
> Thanks,
> Benjamin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to