https://github.com/kriptograf/yii2-mforum
Embeded forum module for yii2 project
https://github.com/kriptograf/yii2-mforum
forum yii2 yii2-extension
Last synced: 5 months ago
JSON representation
Embeded forum module for yii2 project
- Host: GitHub
- URL: https://github.com/kriptograf/yii2-mforum
- Owner: kriptograf
- Created: 2016-12-05T19:18:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-07T12:42:12.000Z (over 9 years ago)
- Last Synced: 2025-01-28T22:49:48.569Z (over 1 year ago)
- Topics: forum, yii2, yii2-extension
- Language: PHP
- Size: 21.5 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
yii2 forum
==========
forum module extension for yii2
Installation
------------
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
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:
```php
'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:
```bash
$ 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 :
```php
= Url::toRoute(['/forum']); ?>```