{"action":"created","issue":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/6944","labels_url":"https://api.github.com/repos/cakephp/cakephp/issues/6944/labels{/name}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/6944/comments","events_url":"https://api.github.com/repos/cakephp/cakephp/issues/6944/events","html_url":"https://github.com/cakephp/cakephp/issues/6944","id":92959127,"number":6944,"title":"PaginatorHelper don't irregular working in custom route rules","user":{"login":"macnie","id":405544,"avatar_url":"https://avatars.githubusercontent.com/u/405544?v=3","gravatar_id":"","url":"https://api.github.com/users/macnie","html_url":"https://github.com/macnie","followers_url":"https://api.github.com/users/macnie/followers","following_url":"https://api.github.com/users/macnie/following{/other_user}","gists_url":"https://api.github.com/users/macnie/gists{/gist_id}","starred_url":"https://api.github.com/users/macnie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macnie/subscriptions","organizations_url":"https://api.github.com/users/macnie/orgs","repos_url":"https://api.github.com/users/macnie/repos","events_url":"https://api.github.com/users/macnie/events{/privacy}","received_events_url":"https://api.github.com/users/macnie/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cakephp/cakephp/labels/Defect","name":"Defect","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/cakephp/cakephp/milestones/47","html_url":"https://github.com/cakephp/cakephp/milestones/3.0.9","labels_url":"https://api.github.com/repos/cakephp/cakephp/milestones/47/labels","id":1184300,"number":47,"title":"3.0.9","description":"Bugfixes and minor improvements for 3.0.x","creator":{"login":"markstory","id":24086,"avatar_url":"https://avatars.githubusercontent.com/u/24086?v=3","gravatar_id":"","url":"https://api.github.com/users/markstory","html_url":"https://github.com/markstory","followers_url":"https://api.github.com/users/markstory/followers","following_url":"https://api.github.com/users/markstory/following{/other_user}","gists_url":"https://api.github.com/users/markstory/gists{/gist_id}","starred_url":"https://api.github.com/users/markstory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstory/subscriptions","organizations_url":"https://api.github.com/users/markstory/orgs","repos_url":"https://api.github.com/users/markstory/repos","events_url":"https://api.github.com/users/markstory/events{/privacy}","received_events_url":"https://api.github.com/users/markstory/received_events","type":"User","site_admin":false},"open_issues":21,"closed_issues":17,"state":"open","created_at":"2015-06-28T17:20:20Z","updated_at":"2015-07-04T03:58:00Z","due_on":"2015-07-12T04:00:00Z","closed_at":null},"comments":2,"created_at":"2015-07-04T01:43:59Z","updated_at":"2015-07-04T03:58:29Z","closed_at":null,"body":"# My Route Rules\r\n```php\r\nRouter::scope('/', function ($routes) {\r\n    /**\r\n     * Here, we are connecting '/' (base path) to a controller called 'Pages',\r\n     * its action called 'display', and we pass a param to select the view file\r\n     * to use (in this case, src/Template/Pages/home.ctp)...\r\n     */\r\n    $routes->connect('/:page.html', ['controller' => 'Posts', 'action' => 'category'],['page'=>'\\d+']);\r\n    $routes->connect('/', ['controller' => 'Posts', 'action' => 'category']);\r\n\r\n    $routes->connect('/category/:id.html', ['controller' => 'Posts', 'action' => 'category'],['id' => '\\d+', 'pass' => ['id']]);\r\n\r\n    $routes->connect('/about', ['controller' => 'Posts', 'action' => 'view',1]);\r\n    $routes->extensions(['json','html']);\r\n    /**\r\n     * ...and connect the rest of 'Pages' controller's URLs.\r\n     */\r\n\r\n    /**\r\n     * Connect catchall routes for all controllers.\r\n     *\r\n     * Using the argument `InflectedRoute`, the `fallbacks` method is a shortcut for\r\n     *    `$routes->connect('/:controller', ['action' => 'index'], ['routeClass' => 'InflectedRoute']);`\r\n     *    `$routes->connect('/:controller/:action/*', [], ['routeClass' => 'InflectedRoute']);`\r\n     *\r\n     * Any route class can be used with this method, such as:\r\n     * - DashedRoute\r\n     * - InflectedRoute\r\n     * - Route\r\n     * - Or your own route class\r\n     *\r\n     * You can remove these routes once you've connected the\r\n     * routes you want in your application.\r\n     */\r\n    $routes->fallbacks('InflectedRoute');\r\n});\r\n```\r\n# My Controller:\r\n```php\r\npublic function category($cat_id = null)\r\n    {\r\n        $key = md5($this->request->here);\r\n        if(intval($this->request->page) >=1){\r\n            $page = intval($this->request->page);\r\n        }else{\r\n            $page = 1;\r\n        }\r\n        \r\n            $conditions = [];\r\n            if(!is_null($cat_id)){\r\n                $this->loadModel('Cats');\r\n                $cat = $this->Cats->find('all',['conditions'=>['Cats.id'=>$cat_id]])->first();\r\n                if(empty($cat)){\r\n                    throw new \\Cake\\Network\\Exception\\NotFoundException();\r\n                }\r\n                $conditions['Posts.cat_id'] = $cat['id'];\r\n                $this->set(\"cat\",$cat);\r\n            }\r\n            if(isset($this->request->query['q']) && !empty($this->request->query['q'])){\r\n                $q = clean($this->request->query['q']);\r\n                $conditions['Posts.title LIKE '] = \"%$q%\";\r\n                $this->set('q',$q);\r\n            }\r\n            $this->paginate = [\r\n                'page'=>$page\r\n            ];\r\n            $data = $this->paginate($this->Posts->find('all',['fields'=>['Posts.id','Posts.title','Posts.thumb','Posts.description','Posts.view_count','Posts.comment_count','Posts.created'],'conditions'=>$conditions,'order'=>'Posts.created DESC']));\r\n        \r\n        \r\n        $this->set('data',$data);\r\n        $this->render('category');\r\n    }\r\n```\r\n# My Paginator:\r\n```php\r\n<?= $this->Paginator->numbers() ?>\r\n```\r\n\r\n# Display Html Code\r\n```html\r\n/** visit 'http://www.macnie.com/4.html ' url, display this: **/\r\n<ul class=\"pagination\"><li><a href=\"/:page.html\">1</a></li><li><a href=\"/2.html\">2</a></li><li><a href=\"/3.html\">3</a></li><li class=\"active\"><span>4 <span class=\"sr-only\">(current)</span></span></li></ul>\r\n```\r\n### the first li can't display normal url;\r\n\r\nBut visit http://www.macnie.com it's fine."},"comment":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/comments/118459341","html_url":"https://github.com/cakephp/cakephp/issues/6944#issuecomment-118459341","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/6944","id":118459341,"user":{"login":"ADmad","id":142658,"avatar_url":"https://avatars.githubusercontent.com/u/142658?v=3","gravatar_id":"","url":"https://api.github.com/users/ADmad","html_url":"https://github.com/ADmad","followers_url":"https://api.github.com/users/ADmad/followers","following_url":"https://api.github.com/users/ADmad/following{/other_user}","gists_url":"https://api.github.com/users/ADmad/gists{/gist_id}","starred_url":"https://api.github.com/users/ADmad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ADmad/subscriptions","organizations_url":"https://api.github.com/users/ADmad/orgs","repos_url":"https://api.github.com/users/ADmad/repos","events_url":"https://api.github.com/users/ADmad/events{/privacy}","received_events_url":"https://api.github.com/users/ADmad/received_events","type":"User","site_admin":false},"created_at":"2015-07-04T03:58:29Z","updated_at":"2015-07-04T03:58:29Z","body":"Can you make a pull request with the proposed fix."}}