0

Intellisense on path when using defined constants

Hi,

In my projects I am using a config file where I define constants based off whether I am working locally or remotely.

if ($local) {
    // Define the constants:
    define ('BASE_URL', 'http://192.168.15.3/example.com/');
}
else
{
    define ('BASE_URL', 'http://www.example.com/');
}


In my code I use something like this to define the location of a src.

<img src="<?php echo BASE_URL; ?>images/image.jpg" />


This works really well, in the sense that local & remote paths are instantly correct. However I lose intellisense when typing out URL's

What is the best solution? Should I be using a URI type path?

Can I set up multiple 'Resource Roots' on a single project and the intellisense will look in these folders too?

Thanks Community!

2 comments

Please sign in to leave a comment.