Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Injecting Value to Json Response
  • Dear,


    I am on a work of AngularJS Application.

    In my angularjs application, i have a observer which always watch for 'notification' key in json array, if it is found. it will be displayed as notification. That is working behind notification.

    so when ever i requested for any information as json. it will passthrough certain code. the code will check for any notification available to user. if so. it will create a notification key in the response json and matter will be injected in notification. how i alter response in EVENT Class.. i think using event is better for it. using hook method.


    Any info appreciated. I want to do it just before the json astring creation in  model hybrid
  • HarroHarro
    Accepted Answer
    The easiest is probably to extend the Hybrid controller, and overload the after() method. There you can access the data array before it is converted to json.

Howdy, Stranger!

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

In this Discussion