Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Custom Model Properties Extension
  • Working with the Fuelphp orm I found it pretty annoying not being able to set instance variables for the model class. i.e. generating a variable like $post->how_long_ago giving something like "2 days ago" from the created_at timestamp field.

    This extension allows you to generate "computed"properties (they are defined after the data has been fetched from the DB). My knowledge of the fuel core is pretty limited and I feel like this is a bit of hack but its been working fine for me and allowed much more flexibility in my models, check it out:


    I wrote up this package to install it but really you could just as easily edit a few lines of code in the core yourself if you want to..
  • I'm trying to understand why you think this is needed.

    The v1.4 supports custom properties on the object without problems, and to deal with data you should use an observer. So this functionality is available out of the box.
  • Ha youre right I guess it was just a matter of me being ignorant of observers! oh well..

Howdy, Stranger!

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

In this Discussion