I would like to know if it is acceptable/preferred to use self::method() and parent::method() when working in php classes.
You can use $this->method() but $this-> can al
another thing to note by the way is that this isn't very good MVC design to be making static controller functions that return lists of categories.
Controllers are for dealing with requests, Models are for dealing with data (which is what this is) and Views are for display.
make a model!
class Category_Model extends Model
{
public function categories($site_id)
{
$categories = $this->db->from('forum_categories')->where('fk_site',$site_id)->get();
return new View('categories_view', array('categories' => $categories));
}
}
...
$cat = new Category_Model;
echo $cat->categories(1);