Welcome Guest, Not a member yet? Register   Sign In
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



Theme © iAndrew 2016 - Forum software by © MyBB