DynamicTemplate::addNewFile
Create a new file in the template called $filename. A new empty file is added to the file system, empty, and a File record created. The file is also added to the manifest if it's a type where that's required.
On error, an exception is thrown, such as if the file type is not supported.
Signature
public function addNewFile(String
$filename,
[boolean
$editable = true,
[String
$sourcePath = NULL]] )
Parameters
$filename
— object- Name of file. Should not contain
slashes, the location will be determined
automatically. $editable
— boolean- If true, the file must be an editable type. If false,
can be used to add images and non-editable files. $sourcePath
— object- If provided, this file is copied to create the new
file contents.