for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace humhub\modules\discordapp\models;
use Yii;
use yii\base\Model;
/**
* ConfigureForm defines the configurable fields.
*/
class ConfigureForm extends Model
{
public $serverUrl;
* @inheritdoc
public function rules()
return [
['serverUrl', 'string'],
];
}
public function attributeLabels()
'serverUrl' => Yii::t('DiscordappModule.base', 'Discord Widget URL:'),
public function attributeHints()
'serverUrl' => Yii::t('DiscordappModule.base', 'e.g. https://discordapp.com/widget?id={server-id} or https://discordapp.com/widget?id={server-id}&theme=dark'),
public function loadSettings()
$this->serverUrl = Yii::$app->getModule('discordapp')->settings->get('serverUrl');
return true;
public function save()
Yii::$app->getModule('discordapp')->settings->set('serverUrl', $this->serverUrl);