|
本帖最后由 cbhjatarj 于 2010-10-27 14:49 编辑
我按照手册上做的一个创建表单的效果.但是提示出错
控制器$urlarray = array();
$this->db->select('typeid, typename');
$query = $this->db->get('arctype');
if ($query->num_rows() > 0)
{
foreach ($query->result() as $row)
{
$urlarray[$row->typeid] = $row->typename;
}
}
然后视图echo form_dropdown('type', $urlarray, '1');报错:A PHP Error was encountered
Severity: Notice
Message: Undefined variable: urlarray
Filename: views/v_article_add.php
Line Number: 16
A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: helpers/form_helper.php
Line Number: 310
另外附加请问一下,大家习惯用这个表单助手来创建表单吗?我自己感觉这个用起来好象并不方便
|
|