Resource URLs

boughtonp edited this page Jan 19, 2012 · 3 revisions

CFEclipse allows you to assign a URL to a folder or file, which means that you are able to open it in the browser, maybe using a different URL to the rest of the files in your project.

For example, if you have the following directory structure:

  • ProjectRoot
    • views
      • index.cfm

And you right click on the "views" folder -> CFEclipse -> Edit URL and set the url to be http://localhost/ then when you are editing index.cfm and click on "Browse" -> "Browse to Current Page" it would then open up the following url: http://localhost/index.cfm

This is all well and good for most cases, but if you are using a framework, such as CFWHEELS you might have the following folder structure:

  • ProjectRoot
    • views
      • mycontroller
        • index.cfm

If you are working on any of the views that are under the mycontroller folder, you would want your url to be something like: http://localhost/mycontroller/index

CFEclipse now allows you to do this by using the snippet syntax in the URL definition.

WARNING: if you DO use snippets in the URL, you will have to compose the whole url, that is, the current path will not be automatically appended to the url

This time, you can right click on the "views" folder -> CFEclipse -> Edit URL and then set the URL as follows:

http://projectr.local/$${CURRENTPRJPATH}/$${CURRENTFILENOEXT}

This would now produce the desired url.

The Variables that you can use are the same as the ones for Code Snippets but a new variable has been added:

$${CURRENTFILENOEXT} - The name of the current file with no extension

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.