Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

combine_files doesn't work in a template


Go to End


2 Posts   1448 Views

Avatar
thany

Community Member, 6 Posts

25 January 2014 at 4:10am

So I tried this:

<% require combine_files("style.css", array(
  "$themeDir/css/reset.css",
  "$themeDir/css/lightbox.css",
  "$themeDir/css/fonts.css",
  "$themeDir/css/form.css"
)) %>

Doesn't work. It spews out a warning:
[Warning] Invalid argument supplied for foreach()

And of course doesn't include the files. Turns out the array is passed as a a string, e.g. "array". Literally.

Avatar
Willr

Forum Moderator, 5523 Posts

29 January 2014 at 9:17pm

Nope you have to use the PHP API for that.