Codeigniter 4 V 4.5.1 $this->db problem |
Just $db->table, without $this
PHP Code: public function get_all_items(){ That will work
Thanks, but I need to have the same instance in all the methods of the class, both to avoid having to declare it in each method and because when I make transactions I often call other methods from the method that manages the transaction so the connection must be the same
Then we can get benefit of protected
Code: protected $table = 'items'; Then: PHP Code: public function get_all_items() Is this what you are looking for? |
Welcome Guest, Not a member yet? Register Sign In |