Question

I'm trying to use the Xml utility class to load some rss feeds into a page, and for some reason I can't seem to load it.

I've been reading the docs and scratching my head for ages, perhaps it's late in the day, but can someone please help? I can see that App should be loaded, but I'm not sure if I need to use App::uses() or App::import()

Any pointer would be great. I'm trying to load it in my app_controller for the meantime. Then I might try and write a datasource for it instead, but I'll still need the Xml utility.

Was it helpful?

Solution

public function view($feed){
    App::import('Utility', 'Xml');
    $feed = Xml::toArray(Xml::build(Configure::read($feed)));
}

Sigh, it's so easy when you are paying attention!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top