• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
gallery error

#1
An uncaught Exception was encountered
Type: RuntimeException
Message: Unable to locate the model you have specified: Gallery
Filename: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\system\core\Loader.php
Line Number: 344
Backtrace:
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\application\controllers\Cpages.php
Line: 201
Function: model
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\index.php
Line: 315
Function: require_once

--------------------------------------



Code:
public function addslideshows() {

        $this->load->model('gallery');
        
        $this->load->view('addslideshows');
    
    }



models/Mpages.php

PHP Code:
public function gallery()
    {
        
$data = array(
            
'slideshow_image' => $this->input->post('slideshow_image'),
            
'image_id' => $this->input->post('image_id'),
            
'title' => $this->input->post('title'),
            
'images' => $this->input->post('images')        
        );
        
        return 
$this->db->insert('slideshow'$data);
            
    } 


controllers/cpages.php

PHP Code:
    public function addslideshows() {

        
$this->load->model('gallery');
        
        
$this->load->view('addslideshows'); 
    
    } 
" If I looks more intelligence please increase my reputation."
Reply

#2
PHP Code:
$this->load->model('gallery'); 

This is looking for a file in the models directory named Gallery.php, but you've pasted a gallery() method from models/Mpages.php.

Read the user guide, especially the Tutorial: https://codeigniter.com/user_guide/tutorial/index.html
and a few of the items in the General Topics section: https://codeigniter.com/user_guide/general/index.html
Reply

#3
a function isn't a model
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.