1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace Plugin\Directory;
- use App\Core\Event;
- use App\Core\Modules\Plugin;
- use App\Core\Router\RouteLoader;
- class Directory extends Plugin
- {
-
- public function onAddRoute(RouteLoader $r)
- {
- $r->connect('directory_actors', '/actors', [Controller\Directory::class, 'actors']);
- $r->connect('directory_groups', '/groups', [Controller\Directory::class, 'groups']);
- return Event::next;
- }
-
- public function onStartTwigPopulateVars(array &$vars): bool
- {
- $vars['main_nav_tabs'][] = ['title' => 'Actors', 'route' => 'directory_actors'];
- $vars['main_nav_tabs'][] = ['title' => 'Groups', 'route' => 'directory_groups'];
- return Event::next;
- }
- }
|