dev-master
9999999-devforum module extension for yii2
MIT
The Requires
- yiisoft/yii2 ~2.0.0
- dektrium/yii2-user *
- kartik-v/yii2-markdown dev-master
- nemmo/yii2-attachments dev-master
by kriptograf
extension yii2 forum
forum module extension for yii2
forum module extension for yii2, (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer require --prefer-dist kriptograf/yii2-mforum "*"
or add, (*4)
"kriptograf/yii2-mforum": "*"
to the require section of your composer.json
file., (*5)
Add following lines to your main configuration file:, (*6)
'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, (*7)
'forumEmailSender'=>'info@yousite.com',
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:, (*8)
$ php yii migrate/up --migrationPath=@vendor/kriptograf/yii2-mforum/migrations $ php yii migrate/up --migrationPath=@vendor/nemmo/yii2-attachments/src/migrations
Once the extension is installed, simply use it in your code by :, (*9)
php
<?= Url::toRoute(['/forum']); ?>
, (*10)
forum module extension for yii2
MIT
extension yii2 forum