A
A
akula222017-03-29 11:52:54
Yii
akula22, 2017-03-29 11:52:54

How to return object from Rbac class?

I created a rule for RBAC and in the controller I do the check like this

if (!Yii::$app->user->can('inTour', ['model' => $tour])) {
            throw new ForbiddenHttpException('Вы не принимаете участия в этом турниире');
        }

and in the InTour class, I pull out all the users in this tournament and want to return them to the controller,
but it only returns true or false
. Can I somehow return an object or an array from there, or not return it, but set the data in the class and get access to them in the controller?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question