Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
What Core classes have you extended? And why?
  • For curiosity and for harvesting ideas, what \Fuel\Core classes have you extended? And for what reason? I'll start.
    I've extended Uri so the creation of urls also takes in consideration a language variable that, for legacy reasons, determines how urls are made. Anyone else? Cheers
  • So far I haven't had the need to extend any core class. I would only do that if it is very application specific, and not solvable without extending. If it's application specific, I put the logic in a separate application class, or if it is generic, I add the feature to the core class. You can do that too, code up your changes and send a pull request. Or if you're not certain, discuss it with one of the dev's first, either via an issue or on IRC.
  • Harro Verton wrote on Monday 20th of August 2012:
    So far I haven't had the need to extend any core class. I would only do that if it is very application specific, and not solvable without extending. If it's application specific, I put the logic in a separate application class, or if it is generic, I add the feature to the core class. You can do that too, code up your changes and send a pull request. Or if you're not certain, discuss it with one of the dev's first, either via an issue or on IRC.

    I try not to modify anything in the core to be able to easily upgrade it, which i think it's a good practice.
    True, many times you need separate classes with different names, but some times you simply need to extend the behavior of an existing core class or to add specific methods, which I think justifies the extension. It rarely happens, though.
  • Hi, I'm trying to extend the asset class because with the default one you can have only 3 type of folder: css, img, js.
    In my case I have many file's type, so I want to create something like: pdf/xml/docx folders.

Howdy, Stranger!

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

In this Discussion