Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7971395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:37:46+00:00 2026-06-04T07:37:46+00:00

I am modifying the model class by completely replacing it. I also wanted to

  • 0

I am modifying the model class by completely replacing it. I also wanted to break most of the components in different classes and to be loaded when they are needed. This particular class has to be loaded in the constructor. A simple model of my classes is as follows:

Model.php

class CI_Model {
     function __construct(){
         load_class('Model_validations', 'core');
     }
 }

Model_validations.php

class CI_Model_validations extends CI_Model {
     private $validations = array();
     public function validates($field){
     }
 }

What I get from the following program is this:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 261904 bytes) in /xampp/htdocs/cms/system/core/Controller.php on line 233

Additionally I tried to remove extends CI_Model and it works just fine.
Also we can say that the CI_Model_validations::validate() method is called immediately after loading but it’s empty and I don’t see how that could cause the problem.

Any ideas?
Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T07:37:47+00:00Added an answer on June 4, 2026 at 7:37 am

    This is because CI_Model tries to load CI_Model_validations which tries to load CI_Model again as it inherits from it. And CI_Model tries to load CI_Model_validations again and so on …

    UPDATE: My assumption above seems wrong from this answer. It says that load_class is a singleton loader.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am modifying a wordpress theme completely, and have run into one very simple
I have a model like this defined... public class Product{ private long timestamp; //
I have a ModelForm field that is based on the following Model: class Phrase(models.Model):
With a simple model like that class Model < ActiveRecord::Base # ... end we
I created a model similar to the following: class Pick(models.Model): user = models.ForeignKey(User) team
I want to implement an Observer of a Model class which does not change
I have a users_manager engine which has a User model class. In an other
I have a Jena ontology model ( OntModel ) which I'm modifying programatically. This
I keep modifying my model in Django. However after I do it I have
Modifying a SnapPages theme, meaning I only have access to the CSS stylesheet. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.