Welcome Guest, Not a member yet? Register   Sign In
strange problem with form_input and attributes array
#1

[eluser]Fabdrol[/eluser]
Hi people,

After quite some years of php experience and writing almost the same code over and over again, I also discovered CI. I could fill this entire topic about the greatness of it, but I don't.

Instead, I post a problem what is teasing me ever since I started coding on my latest project. so. what is wrong?

I use the following code to generate an input field:
Code:
$link_attr = array('name' => 'link', 'id' => 'link', 'value' => 'http://', 'class' => 'form_input');
$data['form'] = form_input($link_attr) . "<br />\n";

when I try to test it, there are two possibilities:
1. the value isn't loaded into the field at all
2. I get this error:
Code:
Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting ')' in /Users/Fabian/Sites/Brilliance Server/codeIgniter/system/application/controllers/dynamics.php on line 50

Is there anybody who knows why this error occures? If I read correctly, the following syntax is presented in the user guide:
Quote:
Code:
$data = array(
              'name'        => 'username',
              'id'          => 'username',
              'value'       => 'johndoe',
              'maxlength'   => '100',
              'size'        => '50',
              'style'       => 'width:50%',
            );

echo form_input($data);

// Would produce:

&lt;input type="text" name="username" id="username" value="johndoe" maxlength="100" size="50" style="width:50%" /&gt;

If somebody could help me, I'd love you forever! ;-P


Messages In This Thread
strange problem with form_input and attributes array - by El Forum - 05-17-2008, 04:21 PM
strange problem with form_input and attributes array - by El Forum - 05-17-2008, 04:34 PM
strange problem with form_input and attributes array - by El Forum - 05-17-2008, 05:57 PM
strange problem with form_input and attributes array - by El Forum - 05-17-2008, 06:15 PM
strange problem with form_input and attributes array - by El Forum - 05-17-2008, 11:30 PM
strange problem with form_input and attributes array - by El Forum - 05-26-2008, 04:28 PM
strange problem with form_input and attributes array - by El Forum - 05-26-2008, 10:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB