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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:44:47+00:00 2026-06-08T15:44:47+00:00

Im trying to integrate phpgrid with my codeigniter program. I need a few clarifications

  • 0

Im trying to integrate phpgrid with my codeigniter program.

I need a few clarifications on how to use the library function.

I have added the phpgrid files to the application/libraries path and I have loaded the libray using $this->load->library('phpGrid');

Below is the code in the phpgrid conf.php file.

<?php
// mysql example
define('DB_HOSTNAME','localhost'); // database host name
define('DB_USERNAME', 'admin');     // database user name
define('DB_PASSWORD', 'pop3'); // database password
define('DB_NAME', xtra); // database name     
define('DB_TYPE', 'mysql');  // database type
define('DB_CHARSET','utf8'); // ex: utf8(for mysql),AL32UTF8 (for oracle), leave blank to use the default charset


define('SERVER_ROOT', '/grid');

/******** DO NOT MODIFY ***********/
require_once('phpGrid.php');     
/**********************************/
?>

Can someone please help me how can I reference the define and require_once files to my library path?

Or is there any other way that I can include the phpgrid files to my CI project?

  • 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-08T15:44:48+00:00Added an answer on June 8, 2026 at 3:44 pm

    I’ve just looked at the PHPgrid source files and it appears that they are encrypted so you are limited as to how much you can fully “integrate” with Codeigniters MVC framework.

    To work with an external library like this, here’s what I would generally do:

    Store a separate config.php file (that looks like the PHPgrid one) that defines the db connection constants in the root directory.

    Then require this in your Codeigniter config/database.php file and use the constants to set the Codeigniter settings as well. So your Codeigniter database.php would look like:

    require_once('config.php');
    
    $db['default']['hostname'] = DB_HOSTNAME;
    
    $db['default']['username'] = DB_USERNAME;
    
    $db['default']['password'] = DB_PASSWORD;
    
    $db['default']['database'] = DB_NAME;
    

    You don’t want to be storing database connection details all over the place.

    Then include config.php at the top of your phpgrid/conf.php file, and use the constants to fill the details the same way, obviously fill out the other phpgrid constants as well.

    Put all the PHPgrid files in a subdir of application/libraries. Now create a new file in your application/libraries file that is called something like ci_phpgrid.php and in it create a new class like below:

    <?php
    require_once('phpgrid/conf.php');
    
    class CI_phpgrid {
    
        public function example_method($val = '')
        {
            $dg = new C_DataGrid("SELECT * FROM Orders", $val, "Orders");
            return $dg;
        }
    }
    

    You can now use this to communicate with php grid, leaving the original files intact.

    In you controller you would just do something like:

    $this->load->library('ci_phpgrid');
    $data['phpgrid'] = $this->ci_phpgrid->example_method(3)
    
    $this->load->view('home_page',$data);
    

    And then in the view you can display the table using:

    $phpgrid->display()
    

    As I mentioned, I’ve not used PHPgrid and you’ll need to include all the relevant JS for sorting etc but this is generally the way you want to approach external libraries in CI.

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

Sidebar

Related Questions

I'm trying to integrate Video4Linux in my managed application. Indeed I've declared all required
I'm trying to integrate bean validation using hibernate validator to my web application :
Im trying to integrate a toolwindow in a Winforms application, it will be a
I am trying to integrate facebook with android mobile, all i need to do
I am trying to Integrate an SMS service into my website. I need to
I am trying to integrate kiip in my android app . I have downloaded
So I'm trying to integrate the PHP facebook SDK/API with codeigniter, because I love
I'm trying to integrate Jawr into my Spring application: <bean abstract=true id=jawrBase class=net.jawr.web.servlet.JawrSpringController> <property
I'm trying to integrate Twitter in my android application. I've checked Android10 and abhinavblog's
I am trying to integrate facebook with in my asp.net mvc web application using

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.