Thanks a lot grigri!

I never think to check out tests files to understand usage...
And sometimes, the logic to call a Cake's core lib is different, for
example if I want to call "extract()" from Set class, I can do a
static call... but for Xml I can't!

BR




On 10 juin, 14:42, grigri <[EMAIL PROTECTED]> wrote:
> Check out the Xml test files (cake/tests/cases/libs/xml.test.php) for
> usage
>
> * Use App::import('Core', 'Xml');
> * You need to instanciate an Xml object; you can't call it statically
>   (since you called it statically from inside your controller, the `
> $this` references inside correspond to the controller)
> * Xml's constructor detects if the string is a path or raw xml and
> handles it correctly
>
> so...
>
> function some_method() {
>   App::import('Core', 'Xml');
>   $channel = '';
>   $xml = new Xml($channel);
>   var_dump($xml);
>
> }
>
> hth
> grigri
>
> On Jun 10, 1:27 pm, avairet <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
>
> > I'm trying to use the Xml class in a controller like that :
>
> > public function MyMethod() {
> >  App::import('Xml');
> >  $channel = 'http://www.mywebsite.com/my_web_services/channel.php?
> > ste_id=123456';
> >  $doc = Xml::load($channel);
> >  var_dump($doc);
>
> > }
>
> > But var_dump is not displayed because of a PHP error:
>
> > Fatal error: Call to undefined method MyController::parse() in D:
> > \developpements\frameworks\cake\actinext_2\cake\libs\xml.php on line
> > 773
>
> > Is it a Cake's core bug or an personnal error?
>
> > Thks by advance for ideas about this issue.
--~--~---------~--~----~------------~-------~--~----~
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