Skip to content

Instantly share code, notes, and snippets.

@bastianallgeier
Last active July 27, 2017 19:04
Show Gist options
  • Save bastianallgeier/7275f1a4513c5dce0611 to your computer and use it in GitHub Desktop.
Save bastianallgeier/7275f1a4513c5dce0611 to your computer and use it in GitHub Desktop.
Sample route setup for Kirby 2
<?php
c::set('routes', array(
array(
'pattern' => 'projects/old-project-url-for-project-a',
'action' => function() {
go('projects/project-a');
}
),
array(
'pattern' => 'blog/archive/(:num)/(:num?)/(:num?)',
'action' => function($year, $month = null, $day = null) {
return array('blog/archive', array(
'year' => $year,
'month' => $month,
'day' => $day
));
}
)
));
@coreytegeler
Copy link

how can you get the returned array in your template?

@dannyfabricant
Copy link

^ I second this question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment