I am writing a custom plugin API that should return PDF, I am using Joomla 5 but I see that it only supports JSON as a return via the View, not only that, but it also requires you to be working with Full MVC structure, is there a away to not do that? I want the flexibility to return a blob or text or whatever from inside the Controller.
class ProductsController extends ApiController
{
protected $contentType = '';
protected $default_view = '';
public function displayList()
{
// I need to be able to return here a blob or whatever i want, right now if i return anything the content type in postmen is always "text/html; charset=UTF-8"
}
}
And this is the view that I don’t really need, but it’s mandatory by Joomla:
class JsonapiView extends BaseApiView
{
protected $fieldsToRenderList = [];
protected $fieldsToRenderItem = [];
}
For reference, these are the docs: https://docs.joomla.org/J4.x:Adding_an_API_to_a_Joomla_Component/en
I did try to just return inside the displayList
method but it’s not working.