Cannot resolve site-relative file paths

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

Cannot resolve site-relative file paths

Postby MichaelPHPDev » April 16th, 2013, 6:02 pm

I cannot find an answer to this issue anywhere on the web.

Currently, on my PHP pages, when I create an HTML reference to say, a CSS file; like so:

Code: Select all
<link rel="stylesheet" href="/css/layout.css" type="text/css" />


Visual Studio (2012) is unable to resolve the path to that file, and will not load my layout.css file. The folder "css" sits on the same file level as the page I am debugging (F5) in VS. I have even tried to place the files themselves on the same level without stepping through a folder.

I found a potential solution elsewhere, using ASP.NET:

Code: Select all
<link href="/content/default.css" rel="stylesheet" type="text/css" />
    <% if (false) {%>
        <link href="../../content/default.css" rel="stylesheet" type="text/css" />
    <% } %>


Source:http://weblogs.asp.net/jeffwids/archive/2009/06/07/why-does-visual-studio-not-resolve-my-css-class-names.aspx

But I was unable to implement this solution using PHP.

Is the inability to resolve (interpret) the relative paths associated with PHP Tools? Or is this strictly a Visual Studio 2012 problem?

If it's the latter, can someone provide a potential work around? Perhaps it is a problem with the root directory that I cannot find?

Thank you very much for any help you can provide. This is killing me right now.
MichaelPHPDev
 
Posts: 1
Joined: April 16th, 2013, 5:52 pm

Re: Cannot resolve site-relative file paths

Postby Jakub Misek » April 17th, 2013, 3:08 pm

Hi,

PHP Editor does not validate paths to linked resources, so I assume you are using HTML Editor to edit .php files? Does your PHP code highlight itself?

Thanks,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 51 guests

cron

User Control Panel

Login

Who is online

In total there are 51 users online :: 0 registered, 0 hidden and 51 guests (based on users active over the past 5 minutes)
Most users ever online was 297 on March 29th, 2024, 7:06 am

Users browsing this forum: No registered users and 51 guests