{"action":"created","issue":{"url":"https://api.github.com/repos/bolt/bolt/issues/3855","labels_url":"https://api.github.com/repos/bolt/bolt/issues/3855/labels{/name}","comments_url":"https://api.github.com/repos/bolt/bolt/issues/3855/comments","events_url":"https://api.github.com/repos/bolt/bolt/issues/3855/events","html_url":"https://github.com/bolt/bolt/pull/3855","id":96713410,"number":3855,"title":"Handle \"add\" parameter for url generator a new way","user":{"login":"CarsonF","id":932566,"avatar_url":"https://avatars.githubusercontent.com/u/932566?v=3","gravatar_id":"","url":"https://api.github.com/users/CarsonF","html_url":"https://github.com/CarsonF","followers_url":"https://api.github.com/users/CarsonF/followers","following_url":"https://api.github.com/users/CarsonF/following{/other_user}","gists_url":"https://api.github.com/users/CarsonF/gists{/gist_id}","starred_url":"https://api.github.com/users/CarsonF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CarsonF/subscriptions","organizations_url":"https://api.github.com/users/CarsonF/orgs","repos_url":"https://api.github.com/users/CarsonF/repos","events_url":"https://api.github.com/users/CarsonF/events{/privacy}","received_events_url":"https://api.github.com/users/CarsonF/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-23T02:43:47Z","updated_at":"2015-07-23T06:50:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/bolt/bolt/pulls/3855","html_url":"https://github.com/bolt/bolt/pull/3855","diff_url":"https://github.com/bolt/bolt/pull/3855.diff","patch_url":"https://github.com/bolt/bolt/pull/3855.patch"},"body":"`Lib::path` and `Lib::redirect` both have an _add_ parameter which takes a string and appends it onto the end of the generated url. An example:\r\n```php\r\n$add = 'foo=bar#derp'; // I'm just an unstructured blob :(\r\n$path = Lib::path('dashboard', [], $add);\r\necho $path; // /bolt?foo=bar#derp\r\n```\r\nAs this class is deprecated (or trying to be :gun:), we need a new way to handle this functionality. \r\n\r\nSymfony's UrlGenerator will already take extra parameters (not needed in path) and add them to the query string of the generated url. This only leaves the _fragment_ part of the url functionality missing. \r\n\r\nI created a wrapper for the UrlGenerator that will take a _fragment_ key from the parameters and append it. This also keeps the same interface/object, so no need for a \"helper\" method. \r\nNew way:\r\n```php\r\n$params = ['foo' => 'bar', 'fragment' => 'derp']; // I'm a nice readable array!\r\n$path = $app['url_generator']->generate('dashboard', $params);\r\necho $path; // /bolt?foo=bar#derp\r\n```\r\n\r\nFunctionality applied to:\r\n-  `editcontent` route which uses a fragment/anchor for _return to_\r\n- MenuBuilder - updated to maintain BC for _add_ key. New functionality works out of the :package:\r\n- There might be other usages the :koala: hid?... beuller?\r\n\r\nWho hates naming? :raising_hand: Let me know if you don't like how something is named, and I can talk you out of it...err..we can talk about it."},"comment":{"url":"https://api.github.com/repos/bolt/bolt/issues/comments/123998177","html_url":"https://github.com/bolt/bolt/pull/3855#issuecomment-123998177","issue_url":"https://api.github.com/repos/bolt/bolt/issues/3855","id":123998177,"user":{"login":"CarsonF","id":932566,"avatar_url":"https://avatars.githubusercontent.com/u/932566?v=3","gravatar_id":"","url":"https://api.github.com/users/CarsonF","html_url":"https://github.com/CarsonF","followers_url":"https://api.github.com/users/CarsonF/followers","following_url":"https://api.github.com/users/CarsonF/following{/other_user}","gists_url":"https://api.github.com/users/CarsonF/gists{/gist_id}","starred_url":"https://api.github.com/users/CarsonF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CarsonF/subscriptions","organizations_url":"https://api.github.com/users/CarsonF/orgs","repos_url":"https://api.github.com/users/CarsonF/repos","events_url":"https://api.github.com/users/CarsonF/events{/privacy}","received_events_url":"https://api.github.com/users/CarsonF/received_events","type":"User","site_admin":false},"created_at":"2015-07-23T06:50:45Z","updated_at":"2015-07-23T06:50:45Z","body":"@rarila I almost went with that, but I was afraid I was being too terse"}}