MadHatter Posted October 13, 2014 Share Posted October 13, 2014 How do I get the directory of my module? I've checked my code and the cwd is the templates directory. One of my modules refers to the site modules but of course you can install into the core as well. I want to be able to load a file from within the module to process but I can't seem to figure out how to get the directory my module is installed into. Link to comment Share on other sites More sharing options...
kongondo Posted October 13, 2014 Share Posted October 13, 2014 (edited) $config->urls->MyModuleClassName; echoing that would return: /site/modules/MyModuleClassName/ http://processwire.com/api/variables/config/ or if you want the URL to your site modules directory. $config->urls->siteModules ...and concatenate as you wish... Change 'urls' to 'paths' if it is the absolute path you want... Edited October 13, 2014 by kongondo 5 Link to comment Share on other sites More sharing options...
MadHatter Posted October 13, 2014 Author Share Posted October 13, 2014 Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now