Completed
Push — master ( 0c34b7...ef90f4 )
by Oscar
02:32
created

Articles::getScheme()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 21
rs 9.3142
cc 1
eloc 14
nc 1
nop 1
1
<?php
2
3
namespace Demo\Entities;
4
5
use Folk\Entities\YamlEntity;
6
use FormManager\Builder;
7
8
class Articles extends YamlEntity
9
{
10
    protected function getBasePath()
11
    {
12
        return __DIR__.'/yaml';
13
    }
14
15
    public function getScheme(Builder $builder)
16
    {
17
        return $builder->group([
18
            'title' => $builder->text()
19
                ->label('Title'),
20
21
            'intro' => $builder->html()
22
                ->label('Introduction'),
23
24
            'category' => $builder->select()
25
                ->options([
26
                    'food' => 'Food',
27
                    'sports' => 'Sports',
28
                    'life' => 'Life',
29
                ])
30
                ->label('Category'),
31
32
            'actived' => $builder->checkbox()
33
                ->label('Actived'),
34
        ]);
35
    }
36
}
37