maxlibin Posted April 30, 2013 Share Posted April 30, 2013 Hi guys, I am new to php oop, I am trying get an object of sibling method inside a class, seems not working. here is how i do it. class Upload extends Base_controller{ private function sql () { $get = Upload::all(); } public function get_index() { dd($this->sql()->get); } } Link to comment https://forums.phpfreaks.com/topic/277437-php-oop-get-sibling-method-object/ Share on other sites More sharing options...
requinix Posted April 30, 2013 Share Posted April 30, 2013 Use return values just like you would any other function. private function sql() { return Upload::all(); } public function get_index() { dd($this->sql()); // ??? } Link to comment https://forums.phpfreaks.com/topic/277437-php-oop-get-sibling-method-object/#findComment-1427234 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.