S
S
sawa42015-07-10 13:46:10
Yii
sawa4, 2015-07-10 13:46:10

Does Yii2 have a comment widget and a forum widget?

Good time everyone!
Does Yii2 have a ready made comments widget and a forum widget that could just be installed via composer?
Search for some reason did not return results ((
"maybe I'm a noob ((("

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vladislav Bushuev, 2015-07-10
@redstar

Well, firstly, it is more correctly called a module. A widget is something else.
https://yiigist.com/package/rmrevin/yii2-comments#...
In general, here is a very good site for extensions for yii and yii2.
https://yiigist.com/
PS There is a forum for the first version , maybe you can rewrite it for version 2.

R
Roman Revin, 2015-08-03
@rmrevin

These are the rules for rbac. If you do not use rbac, then in the module config just specify useRbac = false and ignore this block.
If you still need to use rbac, then you must have a script or migration that creates rbac rules, that's where you need to add these rules.

S
Sergey Doniy, 2016-08-24
@doniys_a

The yii2 forum module is quite good

S
sawa4, 2015-07-11
@sawa4

Good afternoon!
Please help on https://yiigist.com/package/rmrevin/yii2-comments#
where to write

<?php
use \rmrevin\yii\module\Comments\Permission;
use \rmrevin\yii\module\Comments\rbac\ItsMyComment;

$AuthManager = \Yii::$app->getAuthManager();
$ItsMyCommentRule = new ItsMyComment();

$AuthManager->add($ItsMyCommentRule);

$AuthManager->add(new \yii\rbac\Role([
    'name' => Permission::CREATE,
    'description' => 'Can create own comments',
]));
$AuthManager->add(new \yii\rbac\Role([
    'name' => Permission::UPDATE,
    'description' => 'Can update all comments',
]));
$AuthManager->add(new \yii\rbac\Role([
    'name' => Permission::UPDATE_OWN,
    'ruleName' => $ItsMyCommentRule->name,
    'description' => 'Can update own comments',
]));
$AuthManager->add(new \yii\rbac\Role([
    'name' => Permission::DELETE,
    'description' => 'Can delete all comments',
]));
$AuthManager->add(new \yii\rbac\Role([
    'name' => Permission::DELETE_OWN,
    'ruleName' => $ItsMyCommentRule->name,
    'description' => 'Can delete own comments',
]));

it says In auth manager add rules (if Module::$useRbac = true):
but what file do you need, poke your nose, please
, does anyone have this module with an example, where you can see its work?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question