Can Not Call A Method Defined In A Parent Class.

This might be a pure PHP matter, or even something silly, but I can’t understand what’s going on:

I have a module Themes with a module Admin inside. AdminModule extends ThemesModule. I have a method ThemesModule.getMyTheme and in a controller inside the admin module I do this:

Yii::app()->controller->module->getMyTheme();

But I get this error:

AdminModule and its behaviors do not have a method or closure named "getMyTheme".

Yii::app()->controller->module should be an instance of AdminModule, right? but AdminModule is a class extended from ThemesModule, which contains the public functin getMyTheme definition. Why inheritance is not working in this case?

Thanks in advance.

strange thing :lol:

try using reflection to reflect it





 $array1 = get_class_methods($class); 

    if($parent_class = get_parent_class($class)){

        $array2 = get_class_methods($parent_class);

        $array3 = array_diff($array1, $array2);

    }else{

        $array3 = $array1;

    }

print_r($array1); echo '</br>';

print_r($array2); echo '</br>';

print_r($array3); echo '</br>';