i an following this article from cookbook.
http://book.cakephp.org/2.0/en/core-utility-libraries/xml.html#Xml::build
$xmlpath = WWW_ROOT.'files/xml/'.$xmldetails['Xml']['xml_url'];
App::uses('Xml', 'Utility');
if(file_exists($xmlpath)){
$parsed_xml = Xml::build($xmlpath, array('return' => 'simplexml'));
pr($parsed_xml);
die();
}
this is the code that i write in the controller’s method. I get
Fatal error: Call to undefined method Xml::build()
i am not sure y i get this.
any idea?
Looking at your data you have
$xmldetails['Xml']which I assume is a model. If this is the case you have already imported a class calledXmlso cake will not import another.If you want to use cakes
Xmlclass, you can not have a model calledXml.