Emulate request and response

Hi everyone.
I was wondering if any of you have run into this need and solved it in any way. The case is the next:

  1. I made a Markdown view using the .txt extension, in order to create Markdown version of some documents.
  2. This is made with custom CTP files, instead of a serializable view
  3. Now, I would like to take that Markdown content, and convert it to *.docx with the Pandoc tool

I’ve managed to find the requestAction method in controller, wich would allow me to request the *.txt page, save to a file, run shell command pandoc and create another file with the *.docx.
But in the method it states to be deprecated in order to use cells. The fact is I’ve read the docs for cells and don’t quite understand how to call a cell from a controller, get the response, and then save it to file.
Has anyone made something like this in the past?
Saludos,

1 Like

how to call a cell from a controller, get the response, and then save it to file.
Has anyone made something like this in the past?

Call an action, which calls the view, that calls the cell, render that in a variable and then pass it along :slight_smile:

Alternatively, you can load the cell.
https://book.cakephp.org/3.0/en/views/cells.html#loading-cells

1 Like

Hi Karmic.
Your comment allowed me to understand what I had to do, so now I was able to implement what I needed.
Thank you very much.
Saludos,