<?php

namespace humhub\modules\suggestedfollowing\controllers;

use humhub\modules\admin\components\Controller;
use humhub\modules\suggestedfollowing\models\ModuleSettings;
use Yii;

/**
 * Config controller for the Suggested Following module.
 *
 * @package humhub\modules\suggestedFollowing\controllers
 */
class ConfigController extends Controller
{
    public function actionIndex()
    {
        $model = new ModuleSettings();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            $this->view->saved();
            return $this->redirect(['/suggestedfollowing/config/index']);
        }

        return $this->render('index', [
            'model' => $model,
        ]);
    }
}
