0

私のクラス:

class mvc {
    public function home () {
        return 'index';
    }
}

物体:

include "./sys/controller/".$Current_page_Controller_name.".php";

        // making object of the controller class.
            $controller = new $Current_page_Controller_name;

        // Cheks if model is called, m stands for "model"
            if (isset($_GET['m'])) {

            }

            $method_name = $mvc->$Current_page_Controller_name.'()';

    // Cheks if default model exists, if not gives an error.
        if (method_exists($controller, $method_name)) {
            echo "+";
        } else {
            echo "-";
            //die("Lappas sledzis saplisis, gaidiet drizuma... (2)");
        }

このエラーが発生し続けます

Notice: Undefined property: mvc::$home in /home/unusuallv/domains/.../public_html/sys/config.php on line 51

問題は $method_name = $mvc->$Current_page_Controller_name.'()'; 付近にあります。私はそれを知っていますが、私はそれを理解することはできません://tnxたくさん!

4

3 に答える 3