Kurto:

This is easy.

First create a new layout, named xmlout.thtml(name dont matter)

Populate that layout with

<?xml version=1.0?>

and then the standard $content_for_layout.

Next we open your controller,

$this->Render(null,'xmlOut');

this sez, use my new layout!


Then you need to make the actual view.
 Depending on the complexity of your models and desired xml strucutee
you can iterate through the results and 'echo' in the fromat you want.


echo '<persons>';  //<- 'root' element
for each($persons as person){

echo '<person>;'
echo '<name>';
echo '<fname>'.$person['Person']['fname'].'</fname>';
echo '<lname>'.$person['Person']['lname'].'</lname>';
echo '</name>';
echo '</person>'

}

echo '</persons>'


Its reslly that simple.  You may need nestd loops if each peon has
multiple emails for instance.

Good luck!

On Jun 8, 3:27 pm, Kurto <[EMAIL PROTECTED]> wrote:
> I'm begginer of cakephp, I don't know very much so i need a step by
> step help to produce an XML document, what I need to do in the
> controller and what in the view etc.
> Thks
> Kurto
>
> On 8 Giu, 20:33, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>
> > > I haven't found any documentation for produce XML document in
> > > cakePHP.
> > > Someone can help me?
>
> > How is producing XML in cake harder than producing XHTML ?
>
> > > Thks Kurto
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to