You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use knp_pagination_sortable in twig temple, but I want to generate route without default GET-parameters.
For example, default parameters: sort=price, direction=asc, page=1.
And the page https://example.com/some-page is equivalent for this https://example.com/some-page?sort=price&direction=asc&page=1
Well, I want to get first result without GET parameters, but I cann't do it simply.
Processor class is final. I cannot extend it. PaginationExtension in constructor use Processor $processor, so I can't override service knp_paginator.helper.processor. I have only one way - make a new TwigFunction (copy knp_pagination_sortable) and made modifications.
And I want to know, is there some reason why you restrict overriding functionality? I mean most of php-class is final. No interfaces in constructor and events.
The text was updated successfully, but these errors were encountered:
danilphd
changed the title
How can I extend functionality
How can I extend functionality of TwigFunction
Feb 11, 2023
The reason for restricting overriding is limiting the scope of supported files, and so being able to change something without waiting for a major release.
If you feel that implementing an interface makes sense here, you can propose a pull request.
Hi, first of all, thanks for your bundle.
I use
knp_pagination_sortable
in twig temple, but I want to generate route without default GET-parameters.For example, default parameters:
sort=price
,direction=asc
,page=1
.And the page
https://example.com/some-page
is equivalent for thishttps://example.com/some-page?sort=price&direction=asc&page=1
Well, I want to get first result without GET parameters, but I cann't do it simply.
Processor class:
There aren't some events to modify that.
Processor
class is final. I cannot extend it.PaginationExtension
in constructor useProcessor $processor
, so I can't override serviceknp_paginator.helper.processor
. I have only one way - make a new TwigFunction (copy knp_pagination_sortable) and made modifications.And I want to know, is there some reason why you restrict overriding functionality? I mean most of php-class is final. No interfaces in constructor and events.
The text was updated successfully, but these errors were encountered: