Codeigniter失败设置行和行textarea

问题描述:

My view file:

echo form_textarea('',$data['note_order'],"rows='4' cols='50'");

But what I got in the browser:

<textarea name="" cols="90" rows="12">Blablablabla</textarea>

If I change view code like:

$options = array(
    'rows' => 4,
    'cols' => 50
);
echo form_textarea('',$data['note_order'],$options);

I got error:

A PHP Error was encountered
Severity: Notice
Message: Array to string conversion
Filename: helpers/form_helper.php
Line Number: 265

Why my set is not working?

我的视图文件: p>

  echo form_textarea('',  $ data ['note_order'],“rows ='4'cols = '50'”); 
  code>  pre> 
 
 

但我在浏览器中得到了什么: p >

 &lt; textarea name =“”cols =“90”rows =“12”&gt; Blablablabla&lt; / textarea&gt; 
  code>  pre> 
 
 如果我改变视图代码,如: p> 
 
 
  $ options = array(
'worts'=&gt; 4,
'cols'=&gt; 50 
)  ; 
echo form_textarea('',$ data ['note_order'],$ options); 
  code>  pre> 
 
 

我收到错误: p> 遇到PHP错误 Severity:Notice Message:Array to string conversion Filename:helpers / form_helper.php Line Number:265 code> pre>

为什么我的套装不起作用? p> div>

Try this

$options = array(
    'name' => '',
    'rows' => '4',
    'cols' => '50',
    'value'=> $data['note_order']
);
echo form_textarea($options);

I found

echo form_textarea('notes', set_value('notes'), array('rows' => '3'));

results in markup with rows="10"; not what I wanted. Whereas

echo form_textarea(array(
        'name' => 'notes',
        'id' => 'notes',
        'value' => set_value('notes'),
        'rows' => '3'
    ));

(with or without the id element) correctly produces markup with rows="3".