Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COI totally agree with you that the pragmatic approach is often better than anything clever. But is my solution really that clever? It's essentially 1 line of code. I personally think it's elegant, but clever, no. If we were worried that the uninitiated wouldn't be able to follow what was going on, then why would the whole MVC framework allow us to subclass filters in the first place? Filters are kind of essential learning I would have thought for any would-be MVC programmer. I really like your suggestion regarding naming convention by the way. I'm going to edit my original post to reflect that.
      singulars
    2. COFollowing on from my previous comment (due to lack of characters left!) virtually every MVC book or training guide has a whole chapter dedicated to the creation of custom filters. And as long as the naming convention is there (e.g. RenderAccountAndProfile_Anonymous or RenderAccountAndProfile_Authorized) then it should be very easy to read what's going on at a glance, wouldn't it?
      singulars
    3. COSure. I don't think it's a bad solution. The risk is that future maintainers don't understand. They might not understand if your names don't make sense for them (all the time my names make sense to me, and confuse others), or if your method naming convention is not followed, or if these methods get separated spatially in a file. It might also be a problem if you have a case where there is only one or the other, not both. Depending on your context, all those risks might be low (you have a co-located team of MVC ninjas, for example). If you feel like those risks are low, go for it.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload