Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Why is it necessary to add a $data argument when overridding Controller_Template::before()?
  • Just reading the documentation for the first time now, and I'm confused by some wording in the page on controller templates:
    Make before() compatible with that of the Controller_Template: use before($data = null) instead of just before().

    I took a look at the code in v1.1 where Controller_Template is defined, and the before() method takes no arguments. Why, then, is it required that a class would need to use a separate method signature in order to override it? (Sorry for making a second topic - the forum seemed to eat everything after the double-quote the first time around - bug maybe?)
  • Don't know where that text comes from, before() has never had a parameter. after() does though, and that isn't mentioned. I'll update the documentation.
  • Apparently it did have the parameter at one point - a point that ended about seven months ago. I took a look at Fuel's GitHub and found in this commit. I guess the documentation isn't completely wrong, it's just ridiculously outdated on this particular point - I think the commit predates even the 1.0 release. Thanks for taking care of the update. (PS: Is the formatting in this forum broken for you as well? I've tried Firefox and Chrome and it fails in both. I've had to write the BBCode from memory, and it's been a while...)
  • Broken for me as well, the javascript has an error, but it's not a big deal.
  • The theme used doesn't really support the Pyro forum module. We know that, but our designer is busy elsewhere. We're going to swap to a more professional forum soon, so these issues will be solved then.

Howdy, Stranger!

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

In this Discussion