Jump to content

Getting all children template filenames without path


torf
 Share

Recommended Posts

For onpager navigation I'm trying to get the name of all template php files so I can include them based on their status (hidden/shown). But I cannot get the names without the path. So

foreach($page->children() as $child) {
	echo $child->template->filename()."<br/>";
}

gives me the whole path for each file. In https://processwire.com/api/ref/template/filename/# it is stated, that the argument $filename can omit the path, but without examples I'm to dumb to find out how to use it...

PS: of course I could strip it with vanilla php, but if there is already a function for that I'd rather use it.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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