ruzel Posted February 14, 2013 Share Posted February 14, 2013 I'm building my first brand new Processwire site! It's easy and looks really extensible so I'm excited. However, I have a codeigniter app that is going to eventually sit in a directory beneath Processwire and I want to store assets like css, js, and images in a top-level directory that both CI and PW will access. Right now, I've accomplish this by using tags like `<img src="<?php echo $config->urls->templates ?>../../assets/images/russellbits-logo-small.png" alt="Russellbits"/>` Works fine, but it's messy. Is there another way I could do this in PW without making an http call? Link to comment Share on other sites More sharing options...
ruzel Posted February 14, 2013 Author Share Posted February 14, 2013 Ah! Easy-breezy. For anyone looking for an answer to this, there is a variable in the $config->urls for root! So the above image tag can look like this: <img src="<?php echo $config->urls->root ?>assets/images/russellbits-logo-small.png" alt="Russellbits"/> Nice. 1 Link to comment Share on other sites More sharing options...
Wanze Posted February 14, 2013 Share Posted February 14, 2013 Or: $config->urls->assets For other runtime config urls: http://processwire.com/api/variables/config/ 1 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