How to define a webroot different than the project root ?

Hi,

I'm currently trying PhpStorm, and it seems to be a great IDE (although it's a little slow on my old computeur ^^ ).

I have a project like this one :

project_root/
..../apps
..../models
..../some_other_dirs
..../web_root
......../images
......../css
......../js

In my HTML code, I've for example : <img src="/images/my_image.jpg" /> ... But PhpStorm give me an error, saying that it doesn't find the "images" directory (because it search inside "project_root" rather than "web_root" )

Is there a way to change that ?

Thank you.

2 comments

This is also valid for MVC. Basically the view file can't see the controller's paths

Example:

-images (dir)
---image.jpg

-controller (dir)
---controller.php

-view (dir)
---view.php

The view will only be accessed through the controller, basically in the controller.php you include view.php. When you edit view.php, all the links that go through controller.php are not marked as valid. To be more precise, the link images/image.jpg will be marked as invalid.

0

Basically you should add all folders from your php include_path and all folders where your server looks for resources to Settings|Directories.


The problem is that current builds still not allow you to include both / (root) and its subfolder (i.e. /web_root).
See http://youtrack.jetbrains.net/issue/WI-615 and http://youtrack.jetbrains.net/issue/WI-1388
0

Please sign in to leave a comment.