Completed
Push — master ( dd8846...82fafa )
by Amine
03:04
created

RenderCommand::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 0
1
<?php namespace Tarsana\Command\Examples;
2
3
use Tarsana\Command\Command;
4
5
class RenderCommand extends Command {
6
7
    protected function init ()
8
    {
9
        $this->name('Render')
10
             ->version('1.0.0')
11
             ->description('Renders the hello template.')
12
             ->syntax('name: (string:You)')
13
             ->describe('name', 'Your name.')
14
             ->templatesPath(TEMPLATES_PATH);
15
             // this points to /tests/resources/templates
16
    }
17
18
    protected function execute()
19
    {
20
        $message = $this->template('hello')
21
            ->render([
22
                'name' => $this->args->name
23
            ]);
24
25
        $this->console->line($message);
26
    }
27
28
}
29