"_Override" magic method

ddumontddumont ✭✭
When you do this, are you passed the overridden function so that you can call it for some default behavior?

Also, do you know if you can "un-echo" stuff with php or otherwise modify the output buffer?

For example, override a method to change the input it gets called with (by calling it yourself) and then go fix up markup that it printed.
Tagged:

Comments

  • ToddTodd Chief Product Officer Vanilla Staff
    In an override method you are given a reference to the object that you are overriding, so you can call the original method yourself on $Sender.

    PHP has an output buffer and it works like a stack. So if you call ob_start() then echo a bunch of stuff then call ob_get_clean() you will get everything in the output buffer from your call to ob_start(), but you'll leave the rest of the output buffer intact. Really good implementation actually.
  • nice, that's some great info... It gives me a route to go down when you're too busy and i'm twiddling my thumbs trying not to push the close button on your placeholder tasks. ;)
  • @ddumont & @Todd

    Are we talking about Magic Event or Magic Method?

    Seriously, Magic Method got override capability?

  • Override should be a last resort, monkey patch.

    grep is your friend.

Sign In or Register to comment.