【发布时间】:2015-02-02 08:48:18
【问题描述】:
我正在尝试使用 form_helper.php 一个辅助类 codeigniter 2.2.0 以下是我尝试这样做时给出的错误:
控制器文件
$this->load->helper('form');
查看文件
<?php
$attributes = array('class' => 'form-horizontal', 'id' => 'admin-form');
echo form_open($this, $attributes);
?>
错误:
遇到 PHP 错误严重性:警告
消息:strpos() 需要参数 1 是字符串,给定对象
文件名:helpers/form_helper.php
行号:53
遇到 PHP 错误严重性:4096
消息:CI_Loader 类的对象无法 转换为字符串
文件名:helpers/form_helper.php
行号:61
虽然它确实打印了标签。
我在这里做错了什么?
【问题讨论】:
-
form_open($this, $attributes) 我认为是你的问题。第一个参数应该是你要链接的控制器方法。
标签: php html css codeigniter