我在src/My/Bundle/class中有一个类,我需要使用这个函数:
$xml = simplexml_load_file("path_to_xml.xml");
我有这个xml文件在src/My/Bundle/data/file.xml
¿我怎样才能访问这个文件?
谢谢!
try with $this->get('kernel')->getRootDir() . "/../src/My/Bundle/data/file.xml"
我在src/My/Bundle/class中有一个类,我需要使用这个函数:
$xml = simplexml_load_file("path_to_xml.xml");
我有这个xml文件在src/My/Bundle/data/file.xml
¿我怎样才能访问这个文件?
谢谢!
try with $this->get('kernel')->getRootDir() . "/../src/My/Bundle/data/file.xml"