PHPStorm中的“资源根”名称是什么?就此而言,PHPStorm认为什么是资源? [英] What is the 'Resource Root' designation for in PHPStorm? For that matter, what does PHPStorm consider to be a resource?

查看:206
本文介绍了PHPStorm中的“资源根”名称是什么?就此而言,PHPStorm认为什么是资源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许我很胖,但是我无法理解在PHPStorm中创建项目时资源根按钮/名称是什么。看过关于该主题的PHPStorm文档,我发现的唯一解释是变体在下面:

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:


资源根:通过为此类别分配一个文件夹,你告诉
PhpStorm文件在其中,在其子文件夹中可以引用
相对于此文件夹(而不是指定它们的完整路径)。
这些文件夹标有图标[紫色目录]。

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

这不回答我的问题。

推荐答案

我可以回答有趣的是,URL路径将在适用的情况下针对资源根进行解析。例如,在HTML < a href =...> < img src =...> 元素,相对URL根据资源根进行查找。当您在 href src 属性中开始输入时,自动完成将建议这些目录中的项目和URL无法解决将被标记为警告。

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.

这篇关于PHPStorm中的“资源根”名称是什么?就此而言,PHPStorm认为什么是资源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆