rakesh1247
Forum Replies Created
-
Hi @jarednova I have found the issue in \Routes::map() function.
Actually before we were passing multiple routes together by using implode function we made a string of routes to pass as first argument in \Routes::map() function.But now it is not working for us, so can you please tell us if we have to do change in our code or logic?
//string of routes
$pattern = ‘(‘ . implode(‘|’, self::$url_mappings[‘Collection’]) . ‘)’;
// output of $pattern variable is like “(evergreen-trees|house-plants/ferns|redbud-trees|holly-trees)”.\Routes::map($pattern,function($params){
// added code here
});- This reply was modified 2 years, 4 months ago by rakesh1247.
@jarednova I have updated the Timber plugin to 1.20.0 version and WordPress version to 6.0 but still it is not working like it was before WordPress and Timber plugin update.
Now the control is not coming to routers.php file which we use to make custom routes.
\Routes::map('/profile',function($params){ $query = sprintf('posts_per_page=1&post_status=publish&post_type=%s&name=%s','page','profile'); $params['action'] = 'viewUserProfileAction'; $params['controller'] = 'account_controller'; \Routes::load(self::HANDLER, $params, $query, 200); });
Now it is displaying wordpress default pages like for single page it is displaying the single.php file not the custom file which is written in routers.php file.
Do you now the exact reason behind this issue?
Added tags
- This reply was modified 2 years, 5 months ago by rakesh1247.