Avolutions\Command\Template
Used to create classes/files from template files.
Methods
Method | Visibility | Description |
---|---|---|
__construct() | public | Creates a new template instance. |
assign() | public | Replaces a variable/placeholder with a value. |
save() | public | Saves the template including assigned values to a given file/directory. |
Method Details
__construct()
Creates a new template instance.
public
__construct(string $templateFile) : mixed
Parameters
string
$templateFile
Name of the template file.
assign()
Replaces a variable/placeholder with a value.
public
assign(string $key, string $value) : void
Parameters
string
$key
Name of the variable/placeholder to assign.
string
$value
Value to assign.
Return values
void Replaces a variable/placeholder with a value.save()
Saves the template including assigned values to a given file/directory.
public
save(string $file[, bool $append = false ]) : bool|int
Parameters
string
$file
Filename including path. Path and file will be created if not exists.
bool
$append
(optional)
Indicates if the content should be appended to the file (true) or overwrite the file (false).