Sorry, not a big fan of postcards. You couldn't read my handwriting anyway ;-P
As we discussed it today in different context (https://github.com/cakephp/docs/pull/653#issuecomment-21484822) the removal of the function/property won't happen before 3.0 anyway.
This means using the old code should/will work in any past, current and future 2.x version.
See, I dislike Controller::paginate() it has a few problems in my mind:* Half of its parameters get sucked in from a property. Invoking it gives you no clue as to what it is going to do.* It is propped up by 3 different ways to configure it. There should be at most 2. Ideally 1.* It is a snowflake. While it is convenient in testing to have controller methods load and proxy a component, it is the only component with such magic and I feel it expands the features of Controller well beyond its purpose. To me controllers should be handling request + response data and delegating to more informed objects to do actual work.I agree that there should be a better, more singular way to define, and update pagination settings. If the proxy method is useful, perhaps we should explore ways that components can add new mixin methods to controllers as a more formal feature of the framework?
I think the method and property are both bad ideas in the current form. While the deprecation and current implementation are not ideal in 2.x. I don't think Controller::paginate() should exist in 3.0, and we should instead explore alternative ways of providing the same features.I don't think the Controller method + property should exist because they expand the scope of the controller class beyond what it should be doing. Controllers should be mediating request + response cycles and delegating to more informed objects via composition. I think PaginatorComponent is that more informed object, but right now the interface is a bit lacking. Stabbing indexes into its settings array is less than ideal, and we probably should have a method based way of defining and augmenting settings for pagination.As for the present problems I think removing the overloading on __get() makes the most sense as it restores how the feature should have worked, and how people expect it to work based on all the examples, blog posts etc.
You received this message because you are subscribed to the Google Groups "cakephp-core" group.
Deciding how to go forwards wont fix that it's bc-broken/unpredictable in 2.x - I feel that still needs addressing.That said, great points. Especially the snowflake (which I've deliberated on).So lets focus on solutions, what solution could we use to address:
- Being able to define pagination defaults per controller without loading the pagination component?
- a convenient way of calling the paginate function from a controller, honoring any predefined defaults?
- a convenient way of calling the paginate function from a controller overriding any predefined defaults/explicitly defining the config to use?Cheers,AD