Passed
Push — master ( f20f2e...004834 )
by Mihail
05:22
created

Contenttag::actionIndex()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 16
Code Lines 7

Duplication

Lines 16
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 16
loc 16
rs 9.4285
cc 3
eloc 7
nc 2
nop 0
1
<?php
2
3
namespace Apps\Controller\Admin;
4
5
use Ffcms\Core\App;
6
use Extend\Core\Arch\AdminController;
7
use Apps\Model\Admin\Contenttag\FormSettings;
8
9 View Code Duplication
class Contenttag extends AdminController
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
10
{
11
    const VERSION = 0.1;
12
    
13
    public $type = 'widget';
14
    
15
    /**
16
     * Show and edit widget settings
17
     * @return string
18
     */
19
    public function actionIndex()
20
    {
21
        // initialize model and pass configs as arg
22
        $model = new FormSettings($this->getConfigs());
23
        
24
        // check if form of depend model is submited
25
        if ($model->send() && $model->validate()) {
26
            $this->setConfigs($model->getAllProperties());
27
            App::$Session->getFlashBag()->add('success', __('Settings is successful updated'));
28
        }
29
        
30
        // render view output
31
        return App::$View->render('index', [
32
           'model' => $model 
33
        ]);
34
    }
35
}