用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2436|回复: 0
收起左侧

[HELP] Fatal error: Call to undefined method MProducts::getMainFea...

[复制链接]
发表于 2014-2-25 20:30:05 | 显示全部楼层 |阅读模式
本帖最后由 228点六 于 2014-2-25 21:21 编辑

按照《professional codeigniter》按部就班的做下来,结果出了个这样的问题,为什么会有一个未定义的方法?难道是版本问题?


( ! ) Fatal error: Call to undefined method MProducts::getMainFeature() in C:\wamp\www\CI\ci\application\controllers\index.php on line 11
Call Stack
#
Time
Memory
Function
Location
1
0.0006
383880
{main}(  )..\index.php:0
2
0.0020
456984
require_once( 'C:\wamp\www\CI\ci\system\core\CodeIgniter.php' )..\index.php:202
3
0.0528
2731128
call_user_func_array(  )..\CodeIgniter.php:359
4
0.0528
2731176
Index->index(  )..\CodeIgniter.php:359


PHP复制代码
 
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
class Index extends CI_Controller {
    function    __construct(){
        parent::__construct();
        $this->load->helper('url');
    }
    function index(){
        $data['title']="";
        $data['navlist'] = $this->MCats->getCategoriesNav();
        $data['mainf'] = $this->MProducts->getMainFeature();
        $skip = $data['mainf']['id'];
        $data['sidef'] = $this->MProducts->getRandomProducts(3,$skip);
        $data['main'] = 'home';
        $this->load->vars($data);
        $this->load->view('template');
 
复制代码






本版积分规则