What is the 'Resource Root' designation for in PHPStorm? For that matter, what does PHPStorm consider to be a resource?

时光总嘲笑我的痴心妄想 提交于 2019-12-12 08:17:42

问题


Maybe I'm being thick, but I fail to understand what the 'Resource Root' button/designation is for when creating a project in PHPStorm. Having looked at the PHPStorm documentation on the topic, the only explanation I've found is a variation on the following:

"Resource Root: By assigning a folder to this category, you tell PhpStorm that files in it and in its subfolders can be referenced relative to this folder (instead of specifying full paths to them). These folders are marked with the icon [purple directory]."

That doesn't answer my question.


回答1:


I can answer anecdotally that URL paths will be resolved against "resource roots" where applicable. For instance, in HTML <a href="..."> or <img src="..."> elements, relative URLs are looked up against resource roots. When you start typing within the href or src attributes, auto-completion will suggest items in those directories, and URLs which cannot be resolved will helpfully be marked as a warning.



来源:https://stackoverflow.com/questions/24852739/what-is-the-resource-root-designation-for-in-phpstorm-for-that-matter-what-d

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!