Check if file exists in Yii

I am creating a bunch of modules that extend the base module. However, some actions must redefine the base view. In this case, I would like to check whether the new module has a representation in its structure. If so, use this view and otherwise use the base one. Now, my question is:

Is there a way to check if a file exists in Yii using a typical application.views.user.basic_view alias structure without using or importing?

+7
source share
2 answers

Unconfirmed, but what about resolving the alias to the path, then check this ...

  echo is_file(Yii::getPathOfAlias('application.views.user.basic_view'))?'yes':'no'; 
+7
source

All Articles