Welcome Guest, Not a member yet? Register   Sign In
Unable to locate the model you have specified
#1
Rainbow 

I know, not again.

The zip file I extracted from says iot is version 3.0.4 though it is reporting CodeIgniter Version 2.1.3 on the home page.

Directory of models folder:

Code:
03/10/2016  04:55 PM    <DIR>          .
03/10/2016  04:55 PM    <DIR>          ..
03/10/2016  04:06 PM             5,016 Crud_m.php
10/05/2013  11:55 AM               114 index.html
03/10/2016  04:55 PM               358 Schemavesion_m.php
              3 File(s)          5,488 bytes
              2 Dir(s)  309,419,139,072 bytes free

Crud_m.php -
Code:
<?php
class Crud_m extends CI_model
{
   private $s_table;
   
/**
* Contructor
*/
   function __construct ()
   {
       parent::__construct();
   }

/**
*    getTable - returns the table we are dealing with
*/
   function getTable()
   {
       return $this->s_table;
   }

/**
*    setTable - sets the table we are dealing with
*/
   function setTable($s_page)
   {
       $this->s_table = $s_page;
       return $this->s_table;
   }
...
}


Schemaversion_m.php
Code:
<?php
class Schemaversion_m extends crud_m
{
   
/**
* Contructor
*/
   function __construct ()
   {
       parent::__construct();
       parent::setTable('schema_version');
   }

/**
* Version - get schema verison
*/
   function version ()
   {
       $data_a = parent::get();
   }

   
}

Controller -
Code:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Database extends CI_Controller {

/**
* Contructor
*/
 public function __construct()
 {
   parent::__construct();
 }

/**
* Index - Root function
*/
   public function index()
   {
       $this->load->view('welcome_message');
   }
   
/**
* Version - display schema version
*/
   public function version()
   {
       $this->load->model('Crud_m');
       $this->load->model('Schemaversion_m');
       echo 'Schema version is '.'<br/>';
   }
   
}

Executing the version function returns the following error
Code:
An Error Was Encountered

Unable to locate the model you have specified: schemaversion_m
The Crud_m model loads, Schemaversion_m doesn't

Huh
Reply
#2

Er, shouldn't that be Schemaversion_m extends Crud_m ?

The welcome page should definitely not say CI 2.1.3 ... it should have 3.0.4 in the bottom right. If it doesn't, something else could be wrong. Is this a fresh copy, or did you copy 3.0.4 over top of an existing one?
Reply
#3

(03-10-2016, 08:41 PM)ciadmin Wrote: Er, shouldn't that be Schemaversion_m extends Crud_m ?

The welcome page should definitely not say CI 2.1.3 ... it should have 3.0.4 in the bottom right. If it doesn't, something else could be wrong. Is this a fresh copy, or did you copy 3.0.4 over top of an existing one?

Just tried the case thing with the extends, mo joy.

It is a fresh dl this week/
Reply
#4

(03-11-2016, 12:48 AM)lcwakeman Wrote:
(03-10-2016, 08:41 PM)ciadmin Wrote: Er, shouldn't that be Schemaversion_m extends Crud_m ?

The welcome page should definitely not say CI 2.1.3 ... it should have 3.0.4 in the bottom right. If it doesn't, something else could be wrong. Is this a fresh copy, or did you copy 3.0.4 over top of an existing one?

Just tried the case thing with the extends, mo joy.

It is a fresh dl this week/

Where did you download that ZIP from?
Reply
Reply
#6

Well, then it couldn't possibly be reporting 2.1.3 without modifications ... surely you're just looking in the wrong place for that version number. Smile
Reply
#7

I had installed stencil on the site and it seemed to mess some things up. Now at least the views/welcome_message.php is showing the correct CI version. stencil overwrote a lot of things that it didn't need o with CI 2 items. Now I have to get things woprking again.
Reply
#8

And we are back to the original problem:


An uncaught Exception was encountered

Type: RuntimeException

Message: Unable to locate the model you have specified: Schemaversion_m

Filename: C:\Users\larry\Projects\BGA Media\Great Oak\www\system\core\Loader.php

Line Number: 343

Backtrace:

File: C:\Users\larry\Projects\BGA Media\Great Oak\www\application\controllers\management\Database.php
Line: 38
Function: model

File: C:\Users\larry\Projects\BGA Media\Great Oak\www\index.php
Line: 292
Function: require_once
Reply
#9

Found it, typo in the file name. new it would be that simple, especially with my fat fingers.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB