• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Where is the best place to include inc file??

#1
[eluser]OKIEWARDOYO[/eluser]
I have a code like below
Note that $options is a variable in file options.inc.php

Code:
class Welcome extends CI_Controller {

function __construct()
{
  parent::__construct();
  
  
}

function index()
{
  include "options.inc.php";
  return $options['status_index'];
}

function read()
{
  include "options.inc.php";
  return $options['status_read'];
}

function write()
{
  include "options.inc.php";
  return $options['status_write'];
}
}

I'm confusing, where is the best place to place the line of code include "options.inc.php";

i want the code like below
Code:
class Welcome extends CI_Controller {

function __construct()
{
  parent::__construct();
  
  
}

function index()
{
  global $options;
  return $options['status_index'];
}

function read()
{
  global $options
  return $options['status_read'];
}

function write()
{
  global $options
  return $options['status_write'];
}
}

thanks


Messages In This Thread
Where is the best place to include inc file?? - by El Forum - 06-22-2012, 03:22 PM
Where is the best place to include inc file?? - by El Forum - 06-22-2012, 03:46 PM
Where is the best place to include inc file?? - by El Forum - 06-22-2012, 10:14 PM
Where is the best place to include inc file?? - by El Forum - 06-23-2012, 03:46 AM
Where is the best place to include inc file?? - by El Forum - 06-23-2012, 09:35 AM
Where is the best place to include inc file?? - by El Forum - 06-23-2012, 11:14 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.