Kunstmaan / KunstmaanBundlesCMS

An advanced yet user-friendly content management system, based on the full stack Symfony framework combined with a whole host of community bundles. It provides a full featured, multi-language CMS system with an innovative page and form assembling process, versioning, workflow, translation and media managers and much more.
https://kunstmaancms.be
MIT License
406 stars 188 forks source link

ChooserController::chooserShowFolderAction() with custom twig view #3336

Closed delboy1978uk closed 8 months ago

delboy1978uk commented 8 months ago

Hi guys!

ChooserController::chooserShowFolderAction() used to return an array of $viewVars, and now it returns a response.

The current project I am upgrading was adding a pager to the view vars and using a custom twig template. Even although we can use the different view, there is no way to add our pager to the vars being passed to twig.

How would you feel about adding in an additional parameter with a default empty array? This would fix our issue.

public function chooserShowFolderAction(Request $request, $folderId, array $customViewVars = []): Response

And the in the method body:

$viewVars = [
            // existing vars ,
           ...$customViewVars
        ];