I want to do an ajax request over the custom routes. Until now my route looks like the following:
c::set('routes', array(
array(
'pattern' => 'ajax-projects(:all)',
'action' => function($filter) {
header('X-Robots-Tag: noindex, follow');
snippet('project.list', array('pages' => site()->pages()));
}
)
));
My problem is, that the site is multilingual. So i used the l() helper in my snippet. But when the request goes through ajax, the l::get() helper doesnΒ΄t know which language should be shown. The following Notice appears:
Notice: Trying to get property of non-object in /var/www/β¦/kirby/branches/multilang/page.php on line 49
β¦
How can i set the language for the helper manually in my routes?