Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter

Categories

In this Discussion

Who's Online 7

CurtisOdenericgillettemimi59 +4 guests

How to overload Gdn_Form

If I want to overload a model or controller, I can typically do this in a hooks file:
Controller_Method_Create()
But how can I apply that to Gdn_Form or other "core" classes? Doing this:
Form_NewMethod_Create()
doesn't work, and I've tried a number of permutations with the Gdn_ prefix, etc. Could I get the Cliff's Notes on this one? :D

Vanilla developer [GitHub, Twitter]

Comments

  • Posts: 1,586
    Overloading core classes like that is currently not supported. I think allowing you to add new methods is something we can support, but the full before/after/replace is probably not in the cards.

    Is there something you want specifically that I can help get in?

    Vanilla co-founder

  • Posts: 2,058
    Hmm, "overload" was perhaps the wrong term. I'm talking about "Magic Methods" (#4 on http://vanillaforums.org/page/Plugins). Shouldn't I be able to add magic methods to any class?

    Vanilla developer [GitHub, Twitter]

  • Posts: 2,058
    Ah, Gdn_Form doesn't extend Pluggable which is probably the root of that, right? Is there a reason it doesn't? I'm in a little over my head digging into that to determine performance issues or conflicts there.

    Vanilla developer [GitHub, Twitter]

  • Posts: 2,058
    Specifically, this is because I need more flexibility with Gdn_Form::Date, like the ability to optionally do times (like for scheduling an event) or omit the day (ex: credit card expiration). My first idea was to extend Gdn_Form with more methods.

    Vanilla developer [GitHub, Twitter]

  • Posts: 2,058
    bompz?

    Vanilla developer [GitHub, Twitter]

Sign In or Register to comment.