Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 564
Agi Hammerthief Avatar asked Jul 19 '14 15:07

Agi Hammerthief


People also ask

What is Resource Root?

"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]."

Where are PhpStorm settings stored?

By default, PhpStorm stores user-specific files for each IDE instance (configuration, caches, plugins, logs, and so on) in the user's home directory.

How do I find PhpStorm?

From the main menu, select Edit | Find | Find in Files Ctrl+Shift+F . In the search field, type your search string. Alternatively, in the editor, highlight the string you want to find and press Ctrl+Shift+F . PhpStorm places the highlighted string into the search field.


1 Answers

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.

like image 61
deceze Avatar answered Nov 12 '22 04:11

deceze