A text file in which specific parts may be replaced.
A template file is a \FeaturePhp\File\StoredFile which is assumed to have text contents. It has rules (see \FeaturePhp\Specification\ReplacementRule) which specify parts of the file to be replaced, enabling simple feature-based templating systems.
package | Default |
---|---|
inherited_from | \FeaturePhp\File\StoredFile |
__construct(string $fileTarget, string $fileSource, array<mixed,\FeaturePhp\Specification\ReplacementRule> $rules)
inherited_from | \FeaturePhp\File\StoredFile::__construct() |
---|
string
string
array<mixed,\FeaturePhp\Specification\ReplacementRule>
__construct(string $fileTarget)
string
extend(\FeaturePhp\Specification\TemplateSpecification $templateSpecification) : array<mixed,\FeaturePhp\Place\Place>
This is expected to be called only be a \FeaturePhp\Generator\TemplateGenerator. Only uses the rules of the template specification.
inherited_from | \FeaturePhp\File\ExtendFile::extend() |
---|
\FeaturePhp\Specification\TemplateSpecification
array<mixed,\FeaturePhp\Place\Place>
fromSpecification(\FeaturePhp\Specification\TemplateSpecification $templateSpecification) : \FeaturePhp\File\TemplateFile
See \FeaturePhp\Specification\TemplateSpecification for details.
inherited_from | \FeaturePhp\File\StoredFile::fromSpecification() |
---|
\FeaturePhp\Specification\TemplateSpecification
\FeaturePhp\File\TemplateFile
fromSpecification(\FeaturePhp\Specification\FileSpecification $fileSpecification) : \FeaturePhp\File\StoredFile
See \FeaturePhp\Specification\FileSpecification for details.
\FeaturePhp\Specification\FileSpecification
\FeaturePhp\File\StoredFile
getContent() : \FeaturePhp\File\TextFileContent
The content consists of the file content with every rule applied.
inherited_from | \FeaturePhp\File\StoredFile::getContent() |
---|
\FeaturePhp\File\TextFileContent
getContent() : \FeaturePhp\File\FileContent
getTarget() : string
string
render(string $source, array<mixed,array> $rules= array()
, string $directory= null
) : string
string
array<mixed,array>
string
string
$fileSource : string
$fileTarget : string
$rules : array<mixed,\FeaturePhp\Specification\ReplacementRule>