kriptograf / yii2-mforum
forum module extension for yii2
Installs: 55
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- dektrium/yii2-user: *
- kartik-v/yii2-markdown: dev-master
- nemmo/yii2-attachments: dev-master
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2025-03-01 00:11:00 UTC
README
forum module extension for yii2
Installation
The preferred way to install this extension is through composer.
Either run
php composer require --prefer-dist kriptograf/yii2-mforum "*"
or add
"kriptograf/yii2-mforum": "*"
to the require section of your composer.json
file.
Configure
Add following lines to your main configuration file:
'modules' => [ ... 'forum' => [ 'class' => 'kriptograf\mforum\Module', 'defaultRoute'=>'forum/index' ], //depends extensions 'markdown' => [ 'class' => 'kartik\markdown\Module', ], 'attachments' => [ 'class' => nemmo\attachments\Module::className(), 'tempPath' => '@app/uploads/temp', 'storePath' => '@app/uploads/store', 'rules' => [ // Rules according to the FileValidator 'maxFiles' => 10, // Allow to upload maximum 3 files, default to 3 'mimeTypes' => 'image/png', // Only png images 'maxSize' => 1024 * 1024 // 1 MB ], 'tableName' => '{{%attachments}}' // Optional, default to 'attach_file' ] ... ]
Add sender information to common/params.php
'forumEmailSender'=>'info@yousite.com',
Update database schema
The last thing you need to do is updating your database schema by applying the
migrations. Make sure that you have properly configured db
application component
and run the following command:
$ php yii migrate/up --migrationPath=@vendor/kriptograf/yii2-mforum/migrations $ php yii migrate/up --migrationPath=@vendor/nemmo/yii2-attachments/src/migrations
Usage
Once the extension is installed, simply use it in your code by :
<?= Url::toRoute(['/forum']); ?>```