Skip to content

Typos in code in README #36

@bencresty

Description

@bencresty

Fyi: There are some typos in the example code in the README on how to register a custom provider;

The line $event->types[] = MyProvider:class is missing both a colon and a semicolon and throws an error when using it like this. When using this here it needed to be changed into

$event->types[] = MyProvider::class;

I don't know if there are other ways of making these publicly available, but in my case, in order to make it work, I had to add the Event use too, which isn't in the example:

use yii\base\Event;
// ...

I also needed to add namespaces to reach the custom provider, but not sure if that's really required as I'm not a full time php developer and focussed on front end.

Hope this helps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions