0

我正在使用燃料版本 FUEL 1.4 使用 CodeIgniter 3.x 在

Fuel\application\models - 具有以下数据库结构的文件夹

CREATE TABLE `banners` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `image` varchar(255) NOT NULL,
  `upper_text` text NOT NULL,
  `link` text NOT NULL,
  `bottom_text` text NOT NULL,
  `sequence` int(11) NOT NULL,
  `inactiv` tinyint(1) NOT NULL DEFAULT '0',
  `date_added` datetime NOT NULL,
  `date_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

类如下:

require_once(FUEL_PATH.'models/base_module_model.php');
class Home_page_banners extends Base_module_model{
    public $boolean_fields = array('inactiv');
    public $serialized_fields = array('sequence');
    public function __construct()
    {
        parent::__construct('banners'); // table name
    }
        public function form_fields($values = array(), $related = array())
    {   
        $fields = parent::form_fields($values, $related);
                $fields['link']['type']='url';
                if(isset($fields['date_modified'])){unset($fields['date_modified']);}
                $fields['image']['is_image']=TRUE;
                $fields['image']['width']=1920;
                $fields['image']['height']=600;
                $fields['image']['maintain_ratio']=TRUE;
                $fields['image']['resize_and_crop']=TRUE;
                $fields['image']['resize_method']='resize_and_crop';
                $fields['image']['overwrite']=FALSE;
                $fields['image']['display_overwrite']=FALSE;
                $fields['image']['upload_path']='images/banners';
                $fields['image']['encrypt_name']=TRUE;
                $fields['image']['display_preview']=TRUE;
                $fields['image']['remove_spaces']=TRUE;
                $fields['image']['multiple']=FALSE;

                //print_r($fields);
        return $fields;
    }
        public function on_before_save($values)
    {
        $values = parent::on_before_save($values);
                //print_r($values);
        return $values;
    }
    //put your code here
}

问题: 虽然我要保存它,但出现如下错误:

Fatal error: Call to a member function info() on a non-object in

C:\xampp\htdocs\propel\fuel\modules\fuel\models\Base_module_model.php on line 1502 

A PHP Error was encountered

Severity: Error

Message: Call to a member function info() on a non-object

Filename: models/Base_module_model.php

Line Number: 1502

Backtrace:

而图像被上传到图像文件夹而不是 图像/横幅

请帮帮我

4

1 回答 1

-1

您是否已在fuel/application/config/MY_fuel_modules.php 中将其设置为一个简单的模块? http://docs.getfuelcms.com/modules/simple

于 2017-06-01T16:14:26.273 回答