'Array" showing up all over my app |
[eluser]Chad Crowell[/eluser]
http://rj.webinception.com/index.php/sell Notice at the top of the form the word Array? Also it shows up im my header in several places. Anyone know why?? Here is the code that starts the form: Code: <?=$attributes = array('class' => 'form', 'id' => 'sellform'); And the search area of the header: Code: <?=$attributes = array('class' => 'form', 'id' => 'searchform'); Why does CI keep printing out the word 'Array'?
[eluser]PsyCow[/eluser]
PHP short tags return your $data array. Try this : Code: <?php $attributes = array('class' => 'form', 'id' => 'sellform'); PHP short tags "<?=$var?>" is equal to "<?php echo $var; ?>". So when you use it to set your variables $attributes, $data, and $options, it will return the array and so print 'Array' on your page.
[eluser]coolfactor[/eluser]
Code: 'style' => '', The last element in an array should not be followed by a comma.
[eluser]Bulk[/eluser]
[quote author="coolfactor" date="1184243549"] Code: 'style' => '', The last element in an array should not be followed by a comma.[/quote] IMO Only for style reasons - PHP has never thrown an error for that reason for me...
[eluser]coolfactor[/eluser]
Okay, my servers don't like it. Must be a different error threshold.
[eluser]Bulk[/eluser]
Really? :o what error level are you set at? In my dev enviroment I though it was showing everything...
[eluser]coolfactor[/eluser]
Actually, I think you're right. I'm not getting any errors. I must've been thinking about Javascript, which doesn't like that.
[eluser]Chad Crowell[/eluser]
CF I generally do it that way, but I noticed in the CI user guide that they do include trailing commas, so I don't go out of my way to avoid them. |
Welcome Guest, Not a member yet? Register Sign In |