ZionBludd Posted September 3, 2018 Share Posted September 3, 2018 Hi All, I am experiencing issues in including files that are in multiple sub directories. They don't seem to load or break the File Compiler Tags module. My syntax is as follows <?php require 'src/components/breadcrumbs.php'; require 'src/components/topmeta.php'; require 'src/components/page.php'; ?> Anyone else have issues relating to this? I'm using the latest PW build. Link to comment Share on other sites More sharing options...
gmclelland Posted September 3, 2018 Share Posted September 3, 2018 On mobile, Try using ./src/components/etc... Link to comment Share on other sites More sharing options...
horst Posted September 3, 2018 Share Posted September 3, 2018 Use absolute paths, for example, if your src directory is a sub of templates:$config->paths->templates . "src/components/filename.php"; 2 Link to comment Share on other sites More sharing options...
ZionBludd Posted September 3, 2018 Author Share Posted September 3, 2018 1 hour ago, horst said: Use absolute paths, for example, if your src directory is a sub of templates:$config->paths->templates . "src/components/filename.php"; Thanks for your help horst. This worked amazingly. Link to comment Share on other sites More sharing options...
AndZyk Posted September 3, 2018 Share Posted September 3, 2018 Adding to that, if you are using the Functions API, you could also use urls(). ? urls()->templates . "src/components/filename.php"; Or if you don't need to require you could try out wireIncludeFile. wireIncludeFile("./src/components/filename"); 2 Link to comment Share on other sites More sharing options...
adrian Posted September 3, 2018 Share Posted September 3, 2018 26 minutes ago, AndZyk said: Adding to that, if you are using the Functions API, you could also use urls(). ? urls()->templates . "src/components/filename.php"; Probably safer with paths() so you get the full disk path paths()->templates 3 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