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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:03:56+00:00 2026-06-15T14:03:56+00:00

this is a very basic question regarding to Codeigniter. I was reading official documentation

  • 0

this is a very basic question regarding to Codeigniter. I was reading official documentation of Codeigniter from their website regarding to Model, library and etc folder purposes and usage. However, it still confuses me when to use each one of them. What is difference between library and helper? It would be great if someone can provide me a web link or clear definition for each of them and usage example.

Furthermore, I wanted to create a simple library class for testing and under library folder so I have created
Test.php file and it contains

<?php

class Core{

    public function __constructor(){
        echo 'worked';
    }

    public function test(){
           return 'Test function';
    }

}

In my controller, I’m trying to call this using
$this->load->library(‘core’); but it does not work. Also, how do you call test() function from the Core library?

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-15T14:03:57+00:00Added an answer on June 15, 2026 at 2:03 pm

    Model objects are the parts of the application that implement the domain logic, also known as business logic. Commonly used to interface with your database.

    Libraries are classes that can be used in your application.

    Helpers are more like standalone functions that can be implemented.

    Regarding your use of libraries.
    Libraries in CI have the same file name as the class, so either rename you file to core.php or change the name of your class to Test.
    Once you have loaded the library (either directly or using autoload – found in config folder), it gets added to the CI super oject. You can then access it like; $this->core->test();
    N.B. I’m not sure if core is a safe name for use in Codeigniter.

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

Sidebar

Related Questions

This is probably a very basic question but after reading documentation I still can't
This is very basic question from programming point of view but as I am
So this is a very very basic question. I was reading though a class
This is very basic magento question i guess. I want to first get all
This is a very basic question, so please bear with me. Consider the following
This is a very basic question...quite embarassing, but here goes: I have a Stopwatch
This is a very very basic question and I know one way is to
This is a very basic question, but my brain isn't working and multiple attempts
This is a very basic question on Java. I've read somewhere that at first
Apologies if this is a very basic question, but I am preparing to create

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.