Get path to a tools file

Submitted by remo - 4 years ago

Sometimes, you'll have a so called "tool" located in the "tools" directory of your site or package. If you can to make sure you access them in a way which works, no matter if concrete5 is installed in a sub-directory, has pretty URLs enabled or not, use this snippet.

// get file called "my_test"  located in /tools
echo Loader::helper('concrete/urls')->getToolsURL('my_test');

// get files called "my_test" located in /packages/my_package/tools/
echo Loader::helper('concrete/urls')->getToolsURL('my_test', 'my_package');
Stats Categories Tags
comments powered by Disqus