Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Should $summary_fields be able to pass arguments to methods? #2896

kinglozzer opened this Issue · 4 comments

4 participants


For example:

private static $summary_fields = array(
    'Author' => 'Author',
    'Content.LimitCharacters(50)' => 'Content'

My preference is to move away from this kind of eval-ish syntax towards using anonymous functions, any thoughts on that?


I agree that it would be a cleaner solution, there’s probably more margin for error using this syntax than anonymous functions as well. However, we can’t use class properties to configure it which makes the implementation much less simple for developers.

Any ideas on how/where you’d define your anonymous functions? You could override summaryFields(), but you can already do that anyway.


My preference would be for people to override summaryFields for complex situations like this.

@simonwelsh simonwelsh added the 3.1 label
@kinglozzer kinglozzer closed this

Just make a method that returns the summary in the format you expect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.