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 9078847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:43:27+00:00 2026-06-16T19:43:27+00:00

Possible Duplicate: PHP Notice: Undefined property I try to use external library in my

  • 0

Possible Duplicate:
“PHP Notice: Undefined property”

I try to use external library in my CI web. I refer these links
https://www.codeigniter.com/user_guide/general/creating_libraries.html
and CodeIgniter custom library error: Call to a member function on a non-object to make this work
but I get following error message

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Dataloading::$load

Filename: libraries/dataloading.php

Line Number: 28

What I try is load data for combo boxes from library.
here is the code of library class

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 

class Dataloading {

        public function __construct() {

        }

        public function index()
    {

    }

        public function loadcombo(){

        $this->load->model('dataOperateModel');       
        //Calling the getcombo_titel() function to get the arr of titles. Model already loaded.
        $arrStates = $this->dataOperateModel->getcombo_titel();

        //Getting the final array in the form which I will be using for the form helper to create a dropdown.
        foreach ($arrStates as $job_name) {
            $arrFinal[] = $job_name->title;
        }

        $data['job_name'] = $arrFinal;
        $data['main_content']='home/welcome_message';

        //Passing $data to the view, so that we can get the states as an array inside the view.
        $this->load->view('layout',$data);


        }




}

Here is the code of welcome class

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

    class Welcome extends CI_Controller {


            public function __construct() {

                parent::__construct();
                //this condition will check whether user has logged in, otherwise 
                //he will be redirect to login
                if (!$this->session->userdata('logged_in'))
                { 
                     redirect('admin/admin_login');

                }
               // $this->load->model('dataOperateModel');
        }

            public function index()
        {
            //$this->load->view('welcome_message');
                 $this->load->library('dataloading');
                 $this->dataloading->loadcombo();
                 //$this->loadcombo();
        }


    }

can anybody explain where I have done the mistake.

  • 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-16T19:43:28+00:00Added an answer on June 16, 2026 at 7:43 pm

    You need to load Codeigniter instance in order to use Codeigniter core and libraries

    $this->ci =& get_instance();
    

    then you can reference as below

    $this->ci->load(.....)
    

    and it’s better to check how to create your own library

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

Sidebar

Related Questions

Possible Duplicate: PHP: “Notice: Undefined variable” and “Notice: Undefined index” This code shows warnings
Possible Duplicate: PHP: Notice: Undefined variable and Notice: Undefined index I know its basic
Possible Duplicate: PHP: Notice: Undefined variable and Notice: Undefined index I am just learning
Possible Duplicate: PHP: Notice: Undefined variable and Notice: Undefined index I need a really
Possible Duplicate: PHP: Notice: Undefined variable and Notice: Undefined index In this once the
Possible Duplicate: PHP: Notice: Undefined variable and Notice: Undefined index So, I am currently
Possible Duplicate: PHP: Notice: Undefined variable and Notice: Undefined index Hello here is my
Possible Duplicate: PHP: Notice: Undefined variable and Notice: Undefined index Reference - What does
Possible Duplicate: PHP: Notice: Undefined variable and Notice: Undefined index I want when I
Possible Duplicate: PHP: Notice: Undefined variable and Notice: Undefined index Okay, so I am

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.