Create a new file with give content.
App::Utility()->createFile(Data,Path)
Parameter |
Description |
---|---|
Data |
Data to write in the file |
Path |
File path |
See bellow example:
// Crate a new file "test.txt" in "webroot" and write content "Hello World"
echo App::Utility()->createFile('Hello World',App::Config()->baseDir("/test.txt"));