PHP 클래스 RainLab\Builder\Classes\FilesystemGenerator
Example - generate a plugin directory containing the plugin.php file.
The file is created from a template, which uses a couple of variables.
$structure = [
'author',
'author/plugin',
'author/plugin/plugin.php' => 'plugin.php.tpl'
];
$generator = new FilesystemGenerator('$', $structure, '$/Author/Plugin/templates/plugin');
$variables = [
'namespace' => 'Author/Plugin'
];
$generator->setVariables($variables);
$generator->generate();
파일 보기
프로젝트 열기: rainlab/builder-plugin
1 사용 예제들
보호된 프로퍼티들
공개 메소드들
보호된 메소드들
메소드 상세
public __construct ( string $destinationPath, array $structure, string $templatesPath = null ) |
$destinationPath |
string |
Destination path to create the filesystem objects in.
The path can contain filesystem symbols. |
$structure |
array |
Specifies the structure as array. |
$templatesPath |
string |
Path to the directory that contains file templates.
The parameter is required only in case any files should be created. The path can
contain filesystem symbols. |
protected makeFile ( $filePath, $templateName ) |
프로퍼티 상세
$destinationPath 보호되어 있는 프로퍼티
protected $destinationPath |
$templatesPath 보호되어 있는 프로퍼티