this is went against the layer design pattern . the model layer shouldn’t refer to the higher layer(controller layer ) ;
even this can be done as you did:
just import the controller ,use the reflection ;
Yii::import('application.controllers.ProfileController'); //or moduleId.controllers.XXController ;
/**
*
you can use this in your index.php :
Yii::import('application/moduleId.controllers.*');
*/
$methods=get_class_methods('ProfileController');
foreach($methods as $method){
if(startswith($method,'action'){....}
}
note as you said this is not a good way. so never access higher layer in layer architecture (you can only access lower layer);