![]() |
strange problem with form_input and attributes array - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: strange problem with form_input and attributes array (/showthread.php?tid=8433) |
strange problem with form_input and attributes array - El Forum - 05-17-2008 [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'); 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: If somebody could help me, I'd love you forever! ;-P strange problem with form_input and attributes array - El Forum - 05-17-2008 [eluser]Pascal Kriete[/eluser] Can't reproduce, can you do me a favor and try to reduce the error and post a whole controller. For example, does this work for you: Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); strange problem with form_input and attributes array - El Forum - 05-17-2008 [eluser]Fabdrol[/eluser] [quote author="inparo" date="1211081654"]Can't reproduce, can you do me a favor and try to reduce the error and post a whole controller. For example, does this work for you: Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); Hmm I can, but that would be of no help. My class is very very long and I don't think I'd make you happy posting it completely.. but, here is a shortened version: Code: <?php strange problem with form_input and attributes array - El Forum - 05-17-2008 [eluser]Pascal Kriete[/eluser] Right, that's why I said reduced. Basically what I'm asking is if you can reproduce the bug on a small test. I just plugged your function into my setup, replaced all the taal stuff with 'hello', and it rendered perfectly. strange problem with form_input and attributes array - El Forum - 05-17-2008 [eluser]vadivelan[/eluser] Hi CI don't work properly with form submitted arrays like combo boxes, list boxes and check boxes. Have a look at the below thread to deal with that: http://ellislab.com/forums/viewthread/73012/ strange problem with form_input and attributes array - El Forum - 05-26-2008 [eluser]Fabdrol[/eluser] [quote author="inparo" date="1211087719"]Right, that's why I said reduced. Basically what I'm asking is if you can reproduce the bug on a small test. I just plugged your function into my setup, replaced all the taal stuff with 'hello', and it rendered perfectly.[/quote] that's a good idea.. I'll get working on it when I have finished my exams thanks for the help!! strange problem with form_input and attributes array - El Forum - 05-26-2008 [eluser]oddman[/eluser] Which line is line 50? Also, may I also suggest that you remove the display logic (the form generation) from the controller and put it in the view - all that HTML - that's what the view is for (even functions that generate HTML) ![]() |