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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:33:57+00:00 2026-06-05T23:33:57+00:00

I am trying to create a custom User library in CodeIgniter. Inside this library

  • 0

I am trying to create a custom User library in CodeIgniter. Inside this library I would like to use other CodeIgniter libraries and helpers but I am running into erros. Here are the steps I have taken:

  1. I created the User class in a User.php file and uploaded it to applications/libraries/.

  2. Inside application/config/autoload.php I am autoloading the User library.

Here is the code in my User library:

<?php 

    class User {

    private $CI;

        public function __construct()
        {
            $this->CI =& get_instance();
            $this->CI->load->helper('form');
        }

        public function create_login_form()
        {
            echo 'hello';
            echo $this->CI->form->form_open();
        }

    }

/* End of file User.php */

Then in one of my views I am using to call the create_login_form method:

$this->user->create_login_form()

It seems like the method is being called because the hello is being echoed but when it gets to using the form helper form_open method I am getting the following error:

A PHP Error was encountered Severity: Notice Message: Undefined
property: Home::$form Filename: libraries/User.php Line Number: 46

Fatal error: Call to a member function form_open() on a non-object in
…/application/libraries/User.php on line 46

Any ideas what I am doing wrong?

Thanks!

  • 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-05T23:33:58+00:00Added an answer on June 5, 2026 at 11:33 pm

    Helpers provide functions and not methods of some object. You can directly use form_open() after the Form helper is loaded.

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

Sidebar

Related Questions

I'm trying to create a custom usercontrol that acts like a button, but i
I'm trying to write a custom powershell script that will create a local user
I am trying to create a custom user control in WPF. I want to
I'm trying to make an app for create custom cards. I'd like to add
I'm trying to create a custom search but getting stuck. What I want is
We are trying to create a custom event handler that would fire on ItemAdded
I'm trying to create dynamically generated code based on user input (just like a
I am trying to create a custom validator method for phone numbers. I would
I am trying to create a custom control, which behaves a bit like one
I'm trying to programmatically create the custom horizontal menu for my custom module, but

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.