I'm new to CakePHP and am trying to set up a basic controller that returns json or xml data, by following this guide on the cakephp website. http://book.cakephp.org/2.0/en/development/rest.html
The problem is it returns a bunch of excess markup in the case of both json and xml. I'm trying to figure out what's going on with just the xml for now since it's most obvious to see what's broken. It says it should return something like:
<recipes>
<recipe id="234" created="2008-06-13" modified="2008-06-14">
<author id="23423" first_name="Billy" last_name="Bob"></author>
<comment id="245" body="Yummy yummmy"></comment>
</recipe>
<recipe id="3247" created="2008-06-15" modified="2008-06-15">
<author id="625" first_name="Nate" last_name="Johnson"></author>
<comment id="654" body="This is a comment for this tasty dish."></comment>
</recipe>
</recipes>
But instead returns something like:
<resources>
<recipes>
<recipe id="234" created="2008-06-13" modified="2008-06-14">
<author id="23423" first_name="Billy" last_name="Bob"></author>
<comment id="245" body="Yummy yummmy"></comment>
</recipe>
</recipes>
<recipes>
<recipe id="3247" created="2008-06-15" modified="2008-06-15">
<author id="625" first_name="Nate" last_name="Johnson"></author>
<comment id="654" body="This is a comment for this tasty dish."></comment>
</recipe>
</recipes>
</resources>
Looking into the way the Model find function returns data it might be due to the structure of the arrays that come back. I can change the structure around, but wanted to make sure I didn't miss something.