i built a function to charge some values to an array. The thing is that i need to get that array (which is inside a function) from another function.
Don't know how to deal with the parameters.
this is the function where i charge my array:
public function loadStates(){
$states = array(
"Buenos Aires" => "label label-success",
"Catamarca" => "label label-info",
"Chaco" => "label label-warning",
"Chubut" => "label label-danger";
);
return $states;
}
this is the other function (i pretend to call to the function that creates the array so i can load the data to use in the current function):
public function countUsers() {
//breadcrumb
$this->data["states"] = loadStates();
var_dump('$this->data["states"]');die();
//$this->data['totUsers'] = UsersDs::getInstance()->count();
//$this->parser->parse('admin/usuarios/totales/totalRegUsers.tpl',$this->data);
}
these functions are in the same php file. I have erased all the function arguments, so obviously this is not working