Asim Zaidi
Asim Zaidi

Reputation: 28284

the directory for cakephp in xml generation

I uploaded xml file in my cakephp in img/files directory

app->webroot->files->Myfile.xml

and I want to call it from my controller like this

$file = "/files/Myfile.xml";

I am not sure is this the correct path from the controller ot not of course controller is in app->controllers->my_controller

thanks

Upvotes: 0

Views: 104

Answers (1)

Jason McCreary
Jason McCreary

Reputation: 72961

Use one of the CakePHP Core Configuration Constants.

WWW_ROOT for example:

$file = WWW_ROOT . "files/MyFiles.xml";

Upvotes: 3

Related Questions