bcit-ci/CodeIgniter · error · RuntimeException

Class $model doesn't extend CI_Model

Error message

Class $model doesn't extend CI_Model

What it means

Error "Class $model doesn't extend CI_Model" thrown in bcit-ci/CodeIgniter.

Source

Thrown at system/core/Loader.php:362

				require_once($mod_path.'models/'.$path.$model.'.php');
				if ( ! class_exists($model, FALSE))
				{
					throw new RuntimeException($mod_path."models/".$path.$model.".php exists, but doesn't declare class ".$model);
				}

				break;
			}

			if ( ! class_exists($model, FALSE))
			{
				throw new RuntimeException('Unable to locate the model you have specified: '.$model);
			}
		}

		if ( ! is_subclass_of($model, 'CI_Model'))
		{
			throw new RuntimeException("Class ".$model." doesn't extend CI_Model");
		}

		$this->_ci_models[] = $name;
		$model = new $model();
		$CI->$name = $model;
		log_message('info', 'Model "'.get_class($model).'" initialized');
		return $this;
	}

	// --------------------------------------------------------------------

	/**
	 * Database Loader
	 *
	 * @param	mixed	$params		Database configuration options
	 * @param	bool	$return 	Whether to return the database object
	 * @return	object|bool	Database object if $return is set to TRUE,
	 *					FALSE on failure, CI_Loader instance in any other case

View on GitHub (pinned to 3658d731ea)

When it happens

Trigger: Thrown at system/core/Loader.php:362 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of bcit-ci/CodeIgniter@3658d731ea (2026-08-17). Data as JSON: /api/errors/857c567aa27e82b2. Report an issue: GitHub.