HTTP headers with multiple templates?

Hey guys, pardon my noob PHP skills, but how do I send different HTTP headers to different templates?

I currently get a syntax error when I put this in my config:

c::set('headers', array(
  'home' => function($page) {
    header('x-my-first-header: my-value');
  }
  'blog' => function($page) {
    header('x-my-second-header: my-value');
  }
));

Any ideas?

There’s a comma missing:

c::set('headers', array(
  'home' => function($page) {
    header('x-my-first-header: my-value');
  },
  'blog' => function($page) {
    header('x-my-second-header: my-value');
  }
));
1 Like