luya\console\commands\ModuleController::renderReadme PHP Method

renderReadme() public method

Render the readme template.
public renderReadme ( array $folders, string $name, string $ns ) : string
$folders array
$name string
$ns string
return string
    public function renderReadme($folders, $name, $ns)
    {
        return $this->view->render('@luya/console/commands/views/module/readme.php', ['folders' => $folders, 'name' => $name, 'humanName' => $this->humanizeName($name), 'ns' => $ns, 'luyaText' => $this->getGeneratorText('module/create')]);
    }

Usage Example

Example #1
0
    public function testRenderReadme()
    {
        $ctrl = new ModuleController('module', Yii::$app);
        $content = $ctrl->renderReadme([], 'foo', 'app\\modules');
        $tpl = <<<'EOT'
# Foo Module
 
File has been created with `module/create` command on LUYA version 1.0.0-dev. 
 
## Installation

In order to add the modules to your project go into the modules section of your config:

```php
return [
    'modules' => [
        // ...
        'foo' => 'app\modules\frontend\Module',
        'fooadmin' => 'app\modules\admin\Module',
        // ...
    ],
];
```
EOT;
        $this->assertSame($tpl, $content);
    }