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

11,082

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.

Share:
11,082
Agi Hammerthief
Author by

Agi Hammerthief

XP : PHP, MySQL, Drupal (5-7) Web developer (~4 years); Java (~3 Years) Dabbling in : ASM (NASM, GAS), AJAX, CSS, [X]HTML[5], Java, JS/jQuery/JSON, Nim, Python, SQLite and other things. I likely have no idea what I'm talking about. He who discomendeth others obliquely commendeth himself." — Sir Thomas Browne (1605–1682)

Updated on June 15, 2022

Comments

  • Agi Hammerthief
    Agi Hammerthief almost 2 years

    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.

  • Agi Hammerthief
    Agi Hammerthief almost 10 years
    So the site root is a/the resource root, then?
  • Gromski
    Gromski almost 10 years
    Basically yes, AFAIK.
  • FreeLightman
    FreeLightman about 6 years
    So what it the different between source and resource?
  • isherwood
    isherwood over 2 years