Welcome Guest, Not a member yet? Register   Sign In
Get variables created in MY_Controller?
#1

[eluser]chefnelone[/eluser]
hello

I created MY_Controller and defined some variable in it. Now, I don't know how to recover these variables from another controller which is extended to MY_Controller.

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

class  MY_Controller extends Controller{

    function __construct(){  
      parent::__construct();
      define('COMPANY_EMAIL','[email protected]');
      $this->data['company_email']='[email protected]';
    }

}
another_controller.php

Code:
<?php  if (! defined('BASEPATH')) exit('No direct script access');

class Another_controller extends MY_Controller {
   function index(){
      $data['company_email']= //what's in here to get the value of 'company_email' defined in MY_Controller.php
      $this->load->view('index', $data);
   }
}


Messages In This Thread
Get variables created in MY_Controller? - by El Forum - 03-09-2010, 10:59 AM
Get variables created in MY_Controller? - by El Forum - 03-09-2010, 11:52 AM
Get variables created in MY_Controller? - by El Forum - 03-09-2010, 01:29 PM
Get variables created in MY_Controller? - by El Forum - 03-10-2010, 03:20 PM
Get variables created in MY_Controller? - by El Forum - 03-11-2010, 03:22 AM
Get variables created in MY_Controller? - by El Forum - 03-11-2010, 04:34 AM
Get variables created in MY_Controller? - by El Forum - 03-11-2010, 04:38 AM
Get variables created in MY_Controller? - by El Forum - 03-11-2010, 06:24 AM
Get variables created in MY_Controller? - by El Forum - 03-11-2010, 06:39 AM
Get variables created in MY_Controller? - by El Forum - 03-11-2010, 07:24 AM
Get variables created in MY_Controller? - by El Forum - 03-11-2010, 07:52 AM
Get variables created in MY_Controller? - by El Forum - 03-11-2010, 08:36 AM
Get variables created in MY_Controller? - by El Forum - 03-11-2010, 08:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB