[ROUTES] Allow accept-header specification during router creation

Router:
- Fix calls to connect, most of them were misusing the function's params

URLMapper:
- Minor fixes
- Documentation
- Add support for accept-header specification

Plugins/*:
- Fix calls to connect
This commit is contained in:
brunoccast
2019-07-11 19:14:03 +01:00
committed by Diogo Cordeiro
parent 2032c7c1f7
commit 5c0a3102ff
48 changed files with 1023 additions and 871 deletions

View File

@@ -79,16 +79,16 @@ class GroupPrivateMessagePlugin extends Plugin
public function onRouterInitialized(URLMapper $m)
{
$m->connect('group/:nickname/inbox',
array('action' => 'groupinbox'),
array('nickname' => Nickname::DISPLAY_FMT));
['action' => 'groupinbox'],
['nickname' => Nickname::DISPLAY_FMT]);
$m->connect('group/message/:id',
array('action' => 'showgroupmessage'),
array('id' => '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'));
['action' => 'showgroupmessage'],
['id' => '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}']);
$m->connect('group/:nickname/message/new',
array('action' => 'newgroupmessage'),
array('nickname' => Nickname::DISPLAY_FMT));
['action' => 'newgroupmessage'],
['nickname' => Nickname::DISPLAY_FMT]);
return true;
}