A
A
Alexander2014-04-15 21:35:31
phpstorm
Alexander, 2014-04-15 21:35:31

How to convince PHPStorm to resolve relative paths to files?

The PHP project structure is visible in the figure.
/index.php - the main script
itself /ext_addons/css/... - css files are
located here /view/_general.tpl - this is a smart template. It has a link href="ext_addons/css/...
When I run index.php, the link works. But PHPStrom doesn't know about it and keeps warning me.
I can't change the path to be relative to the root of ext_addons/css/... -> / ext_addons/css/... because I want the script to work when placed in any directory
Is there any way I can change the behavior of phpstorm so that it checks files normally I don't want to disable/suppress the check.
120f8a6be0344199ac202766364bc461.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Mikhail Osher, 2014-04-16
@miraage

Try to mark the root folder where "ext_addons" is located:
*rightclick* > Mark Directory As > Resource Root

A
Alexander, 2014-04-16
@Survtur

Got a response from JetBrains.
no, there is currently no way to get these paths resolved. Please feel free to file a request for this enhancement to youtrack. Related ticket: youtrack.jetbrains.com/issue/WEB-11660

-
----, 2016-10-10
@stalkerxxl

I have the opposite problem: Storm defaults paths like "catalog/file.jpg"... but I need to immediately set "from the root of the site": /catalog/file.jpg...
How to force it to set paths like this by default?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question