Create a new file with give content.
App::Utility()->savefilecontent(Path,Data,Mode)
Parameter |
Description |
---|---|
Path |
Path of file |
Data |
Date to write in file |
Mode |
File Open mode. By default set to 'w' |
See bellow example:
// Open file in Append mode and Save "test.txt" in "webroot" and add content "Hello World".
echo App::Utility()->savefilecontent(App::Config()->baseDir("/test.txt"),'Hello World','a');