0

So i'm trying to output the content of a template in xml and saw that the documentation mentioned an output class with functions like set_content_type (https://docs.expressionengine.com/latest/development/legacy/libraries/output.html). When I try to call this function using:

ee()->output->set_content_type('xml');

the page loads with an error:

"Call to undefined method EE_Output::set_content_type()"

Other functions of the output class such as "parse_exec_vars" work fine. Am I forgetting something that allows this function to be used? Also I am currently using expressionengine4

  • I'm trying to directly output a PDF file in a secure manner and experiencing this same issue...still trying to figure out why I get the error "Call to undefined method EE_Output::set_content_type()" when trying to set the mime type for display. I can output the file content, but without setting the content type, it just shows the raw information in the browser window. – Te3d Feb 22 '19 at 19:09
  • @Te3d this is an old question. You'll have better luck getting an answer if you post a new question with specific details about your situation. – Alex Kendrick Feb 26 '19 at 21:12
0

Maybe it's not relevant but in the Add-ons there's XML encode. Is it installed?

| improve this answer | |
  • I’ll have to check when I go back into work. That’s a good idea though! – justplanechad Oct 20 '18 at 15:19
  • Did you find a solution? – Benoit L Oct 28 '18 at 16:31
  • I made sure that add on was installed but I wasn’t able to figure out why I couldn’t use set_content_type. I ended up realizing EE let’s you process php on input even with xml file types. Thanks for trying to help though! – justplanechad Oct 30 '18 at 23:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.