Jump to content

Recommended Posts

Posted

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. 

Posted

Use absolute paths, for example, if your src directory is a sub of templates:
$config->paths->templates . "src/components/filename.php";

  • Like 2
Posted
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.

Posted
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

 

  • Like 3

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...