-
I want to set my own layout for my API documents. No problem, I thought, I just create one, and use that in my API controller(s). However, this seems to make no difference to my output as the document that is actually used to generate output (both in the API and the other interfaces I think) is created in the relevant application class (ApiApplication in this case). It looks like I ought to be able to use the DI container to effect what I want, but I can't for the life of me work out how. Can someone inform me (please). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Well, I have a solution. I'm simply loading my custom document into my app object and then setting it in the view in my controller.
I've subclassed ApiController for this. This was prompted by the need to push json stored in my component table out through the API. I'd hoped to try to use a similarly custom resource object, but can't find a way to inject it into the existing document setup and of course the current api document can't be prevented from trying to json encode my already encoded string. Is there a more Joomla-ish way to do this? |
Beta Was this translation helpful? Give feedback.
Well, I have a solution.
I'm simply loading my custom document into my app object and then setting it in the view in my controller.
I've subclassed ApiController for this.
This was prompted by the need to push json stored in my component table out through the API. I'd hoped to try to use a similarly custom resource object, but can't find a way to inject it into the existing document setup and of course the current api document can't be prevented from trying to json encode my already encoded string.
Is there a more Joomla-ish way to do this?