Routing and Page Handling

Hi everyone,

Elgg offers a facility to manage our plugin pages via custom routes as explained here. But I have some troubles for defining some routes.

I want to register a route with a particular path.

The path will start with the "permalink'  and the remaining part of the path is not predefined. So the remaining part of the path can contain any valid relative url.

The remaining part of the path can be something like this default/370/where-does-it-come-from-where-does-it-come-from-where-does-it-come-from?ps=cdab518b47b0fe0a1fa802b752f224e4.

So the final path can be 

/permalink/default/370/where-does-it-come-from-where-does-it-come-from-where-does-it-come-from?ps=cdab518b47b0fe0a1fa802b752f224e4

I have the same trouble with walled_garden.

How can I register such route in elgg-plugin.php ?

return [
        'bootstrap' => \Pessek\Piwal\Bootstrap::class,
        'routes' => [
               'pessek:permalink' => [
                       'path' => '/permalink/{?}',
                       'resource' => 'Pessek/permalink',
                ],
        ],
];

 

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking