Xml is a helper used in view not in the controller (your code would output
malformed xml); if you build the xml in controller it can only be put as xml
in view
build vars and set them to the controller; the requesthandler comp may help
you also (and setting parse extensions for xml may also be worth your while)
if using the requesthandler with parseextensions
if( $this->*RequestHandler*->*isXML*() ) {
// prevent debug out put as this malforms xml
configure::write('debug',0);
// now do stuff with $this->data, build & set content var to view
...
$this->set('content', $content);
}
re the Facebook stuff you should check Webtechnick's Facebook Plugin (his
Gigya plugin may also be of interest)
- S
On 10 May 2011 16:45, Weilies Chok <[email protected]> wrote:
> Item 1
> Controller
> function toxml()
> {
>
> echo $this->Xml->elem('count', null,
> array('cdata'=>true,'value'=>'content'));
> // generates: <count><![CDATA[content]]></count>
>
> }
>
> View
>
> <?php
> echo $this->Xml->header();
> // generates: <?xml version="1.0" encoding="UTF-8" ?>
> ?>
>
>
> Error
>
> *Notice*
>
> (8): Undefined property: PostsController::$Xml [*
> APP/controllers/posts_controller.php*, line *80*]
>
> *Fatal error*: Call to a member function elem() on a non-object in *
> /Applications/MAMP/htdocs/cakephp/app/controllers/posts_controller.php* on
> line *80*
>
>
>
> What is the magic keyword to initiate XML?
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group
> at http://groups.google.com/group/cake-php
>
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php