Skip to content

Simple response decoration #152

@tprochazka

Description

@tprochazka

I'm migrating my app from using great Drahak\Restful, because this library is sadly not maintained.
It is based directly on Nette presenters, which is also somehow supported by Apitte, but deprecated.
So I'm trying to avoid it. But I miss Nette presenter's life-cycle. I mean that it calls some method before and some method after the main method generating content.

So I can simply do some common preparation in one place, then execute requested action, which just prepares data as array() structure. And then again in one place add some additional data, convert it to JSON, and put it into some envelope. In Appite itis probably possible by some request/response decorators, but it is too general. Is any way how to do it only on one class level? Like, create a decorator that will actually look for some method inside of the source Controller?

Or should I switch to use https://github.com/apitte/presenter ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions