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

  • Home
  • SEARCH
  • 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 6647613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:33:30+00:00 2026-05-26T00:33:30+00:00

I am recoding my site using CodeIgniter. This is my first time using an

  • 0

I am recoding my site using CodeIgniter. This is my first time using an MVC or any other type of development pattern. I am using the video tutorials off of the CI site to make a playground and get acquainted with the protocol of the system.

I’ve just encountered my first problem and it has to do with a parent class.

I am on the second tutorial trying to make a blog and have this:

<?php

class Test extends CI_Controller {

    function Test()
    {
        parent::CI_Controller();

        $this->load->scaffolding('entries');
    }

    function index() 
    {
        $data['muck'] = 'test test test';
        $data['kookoo'] = 'howdy howdy hi';
        $data['hi'] = 'holla';
        $data['yo'] = 'fa la la';
        $data['zoom'] = '1234';
        $data['array'] = array('hi','howdy','hey','sup');
        $this->load->view('test_view', $data);
    }

}

?>

When I loaded the page without the content inside the function Test() I noticed that the system could not find “Controller”. I discovered that the tutorial is using an older version of CI and that “CI_Controller” is the proper name for the class Controller. Now with the above code I’m getting this error:

Fatal error: Call to undefined method CI_Controller::CI_Controller() in /Users/michaelsanger/Sites/CodeIgniter/application/controllers/test.php on line 7

I’ve scoured and am really not sure why it can’t define it.

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-05-26T00:33:30+00:00Added an answer on May 26, 2026 at 12:33 am

    You’re mixing up things from different versions, the 1.7 one focusing mainly on PHP4-style class construction (using a method with the same name as the class as constructor, instead that the dedicated magic method __construct() available in php 5)

    Also, beware that scaffolding is not present in the latest versions. You didn’t say which one are you using, I suppose V2. In case you’re using an older version, 1) use the latest 🙂 2) the parent class was just Controller.

    It should be like this

    class Test extends CI_Controller {
    
         function __construct()
         {
             parent::__construct();
    
             //$this->load->scaffolding('entries');
         }
    
         function Test()
         {
          // this will call a method name test, so maps to a URL like Test/test
    
         }
    
    }
    

    Note that it’s not needed to extends the parent controller, unless of course you want to “autoload” a library to have it available to all methods.

    CI is known for its great and easy documentation, so whenever you’re using tutorial found on the net, expecially if a bit old (in internet terms), make an habit of going to the user_guide (which is also shipped along with the installation files, for local browsing) whenever you have doubts or problems.

    For example, check the controllers page, you’ll soon see what’s wrong with your snippet (and the tutorial, as of today)

    UPDATE:

    In routes you’re setting a route, that maps to a controller(/method).
    Quoting the changelog:

    Version 2.0.0

    Release Date: January 28, 2011 Hg Tag: v2.0.0

    General changes
    
    PHP 4 support is removed. CodeIgniter now requires PHP 5.1.6.
    Scaffolding, having been deprecated for a number of versions, has been removed.
    

    So I don’t know what you mean now with scaffolding. Looking at your route, CI expects a controller named “scaffolding_trigger”, which has to be rerouted to the controller “scaffolding”. If any of those are present, you get the 404 error.
    Please, choose a version and stick to that, don’t mix things! and don’t rely on tutorials, they’re not always up-to-date with the latest changes.

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

Sidebar

Related Questions

I'm recoding an old site that contains a chart similar to this: alt text
First is there any technique for using Action Script for recording sound from microphone?
What type of technology can I program to do the same as this site
I'm new here. I have been trying to create a video capture app using
Can any one help me in recording time spent by the user in a
I'm really confused by the Selenium web site. At first they go to great
I'm recoding an existing project by using the CakePHP framework. Now, in my existing
I am developing an application for video recording and I want to overlay the
I am working on a collection of classes used for video playback and recording.
for one of my customer's I implemented a site that displays a questionaire. The

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.