Welcome Guest, Not a member yet? Register   Sign In
Where to store a rarerly changing variable for the app?
#2

[eluser]InsiteFX[/eluser]
Use a MY_Controller

Save as ./application/core/MY_Controller.php
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Base_Controller extends CI_Controller {

/**
  * -----------------------------------------------------------------------
  * Class variables - public, private, protected and static.
  * -----------------------------------------------------------------------
  */


  // ----------------------------------------------------------------------

/**
  *  __construct
  *
  * Class Constructor PHP 5+
  *
  * @access public
  * @return void
  */
  public function __construct()
  {
   parent::__construct();

}

  // ----------------------------------------------------------------------

/**
  * Index Page for this controller.
  *
  */
public function index()
{

}

}

// ------------------------------------------------------------------------
/* End of file Base_Controller.php */
/* Location: ./application/core/MY_Controller.php */

Now extend your other controllers from this Base_Controller

You can create static variables that will retain there value.


Messages In This Thread
Where to store a rarerly changing variable for the app? - by El Forum - 01-31-2012, 03:56 PM
Where to store a rarerly changing variable for the app? - by El Forum - 01-31-2012, 06:28 PM
Where to store a rarerly changing variable for the app? - by El Forum - 01-31-2012, 06:31 PM
Where to store a rarerly changing variable for the app? - by El Forum - 02-01-2012, 03:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB