Cannot resolve files/directories in a MVC pattern


I'm having trouble having PHP Storm resolve files or directories while coding a PHP application using the MVC pattern (Model View Controller) with a router.

The pattern itself induces the use of a lot of ‘require’ that are interwoven into each other, which seem to be causing the issue. Is there anyway to fix that ? It's creating unnecessary warnings and is preventing me from using the ‘jump to source’ (F4) function.

Here's an example:

*The file tree is as such.

* I have a router file at the root of the project, which requires the ordersController.php and call a function newOrder() in a controller.

                                      - router.php

* The controller then calls for a view, and I get the warning.

                                       - ordersController.php


I cannot enter the relative path of the newOrderView.php file seen from the ordersController.php file (which would be ‘../views/orders/newOrderView.php’), because it is called from the main router file as the controller is required at the beginning of it. 

Thank you for your help,



Please sign in to leave a comment.