E
E
EvgMul2018-10-07 14:44:12
Yii
EvgMul, 2018-10-07 14:44:12

Why is the component configuration not loaded into the component?

Hello. Installed component for yii2 'sendPulse'. https://packagist.org/packages/sevenfloor/yii2-sen... I wrote
everything according to the instructions in the components config:

'sendpulse' => [
            'class' => \sevenfloor\sendpulse\SendPulse::className(),
            'userId' => 'id',
            'secret' => 'secId',
            'storageType' => 'session'
        ],

But if I try to create an instance of the class, an exception is thrown:
$sendPulse = new SendPulse();
Exception 'yii\base\Exception' with message 'Empty ID or SECRET'

Those. the class does not see the userId and secret parameters. Please tell me what am I doing wrong?
Thanks in advance to all who respond.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem, 2018-10-07
@EvgMul

you access the component through the application object, and not by creating it manually. Yii::$app->sendpulse

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question