there is a small typo in description
on the end is written
<?php
/* functions.php */
Routes::map('info/:name/page/:pg', function($params){
//make a custom query based on incoming path and run it...
$query = 'posts_per_page=3&post_type='.$params['name'].'&paged='.intval($params['pg']);
//load up a template which will use that query
$params = array();
$params['my_title'] = 'This is my custom title';
Routes::load('archive.php', $params, $query, 200);
});
what you do with "$params = array();" is that you are unnecessarily wiping out the $params value from the function context. In this case we we loose the "$params['pg']" and other data.
Hello,
there is a small typo in description on the end is written
what you do with "$params = array();" is that you are unnecessarily wiping out the $params value from the function context. In this case we we loose the "$params['pg']" and other data.