• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding to data array for all functions in model

#4
[eluser]Pascal Kriete[/eluser]
$data is a class variable, so you have to access it in the class scope, by using $this:
Code:
function getCategories(){
    $query = $this->db->query("SELECT * FROM article_categories");
    $categories = $query->result_array();
    $this->data['categories'] = $categories;
    return $this->data;
}


Messages In This Thread
Adding to data array for all functions in model - by El Forum - 09-24-2008, 12:43 PM
Adding to data array for all functions in model - by El Forum - 09-24-2008, 12:51 PM
Adding to data array for all functions in model - by El Forum - 09-24-2008, 01:02 PM
Adding to data array for all functions in model - by El Forum - 09-24-2008, 01:29 PM
Adding to data array for all functions in model - by El Forum - 09-24-2008, 01:31 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.