Very simple setting, but I simply don't get it...
functions.php
class functions {
function output_functions() {
function sendMail($to, $subject, $message){
//...code...
}
}
}
myfile.php
include $_SERVER['DOCUMENT_ROOT'] ."some/subfolders/functions.php";
$myFunction = new functions();
$myFunction->output_functions()->sendMail("mail@mail.com","My Subject","My Message");
And I'm getting the Error:
Call to a member function sendMail() on null
Any help will be highly appreciated!