Hi I was following code igniter user guide for forms and I encountered this strange output can anyone tell how to fix it?
Here is my code for beginning of the form
<?=$attributes = array('class' => 'email', 'id' => 'myform');?>
<?=form_open('email/index/', $attributes); ?>
I get form with id and class which I specified above but for some reason annoying Array text prints out and I cant figure out why, can anyone help? t开发者_如何学Pythonhank you
Try
<? $attributes = array('class' => 'email', 'id' => 'myform');?>
<?=form_open('email/index/', $attributes); ?>
The <?= ?>
is a shortcut to <?php echo ... ?>
, so your $attributes
array would not only be created, but also printed.
The <? ?>
is a shortcut for <?php ?>
so that should fix it.
You are evaluating an Array type variable to a string somewhere. It may have nothing to do with the form. Were you trying to echo/print somethign else up higher in the processing chain for debug that happens to be an array?
精彩评论