[Poll] Fixed ShowPoll route, moved Poll Entity, created NewPollForm

Entity was temporarily moved to src/Entity in order to load from DB, since it is yet no possible to do that from Plugin
This commit is contained in:
Daniel
2020-11-03 15:53:46 +00:00
committed by Hugo Sales
parent 03f02bed4d
commit dbb55362c8
6 changed files with 74 additions and 20 deletions

View File

@@ -64,7 +64,8 @@ class PollPlugin extends Module
public function onAddRoute($r)
{
$r->connect('newpoll', 'main/poll/new', [Controller\NewPoll::class, 'newpoll']);
$r->connect('showpoll', 'main/poll/{id<' . ID_FMT . '>}' , [Controller\ShowPoll::class, 'showpoll']);
//$r->connect('showpoll', 'main/poll/:{id<' . ID_FMT . '>}' , [Controller\ShowPoll::class, 'showpoll']); //doesnt work
$r->connect('showpoll', 'main/poll/{id<\\d*>}',[Controller\ShowPoll::class, 'showpoll']);
return Event::next;
}