Welcome Guest, Not a member yet? Register   Sign In
$this->load->vars($array)
#3

[eluser]xwero[/eluser]
The load->vars function adds the array to an Loader class variable that is used in the load->view function where the array gets extracted.

So in order to use it you have to load a view file.

If you need a array that is accessible throughout the class you have to do this
Code:
class Blog extends Controller
{
    var $pr = array();

    function Blog()
    {
        parent::Controller();    
        $this->pr=array(1,2);
        
    }
    
    function index()
    {
        
        print_r($this->pr);
        
    }
}

EDIT : inparo beat me that makes it 1-1 this morning Smile


Messages In This Thread
$this->load->vars($array) - by El Forum - 06-30-2008, 03:19 AM
$this->load->vars($array) - by El Forum - 06-30-2008, 03:36 AM
$this->load->vars($array) - by El Forum - 06-30-2008, 03:38 AM
$this->load->vars($array) - by El Forum - 06-30-2008, 04:03 AM
$this->load->vars($array) - by El Forum - 06-30-2008, 04:08 AM
$this->load->vars($array) - by El Forum - 06-30-2008, 04:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB