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

In this Discussion

"_Override" magic method

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.

My addons: NillaBlog | Vanoogle

Tagged:

Best Answer

  • ToddTodd Chief Product Officer vanilla
    Answer ✓
    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.

Answers

Sign In or Register to comment.