Mautic Community Forums

getModel() method error: is not a registered container key

An exception occurred when i call $this->getModel('customdashboard.embed') inside my Controller.

I used the correct nomenclature (mautic.UNIQUE_BUNDLE_IDENTIFIER.model.MODEL_IDENTIFIER), plugin’s name is CustomDashboardBundle and my model inside Model directory is EmbedModel and extends CommonModel ( i tried to extend also FormModel ).

The exception occurred when i try the route that call controller’s action with $this->getModel(‘customdashboard.embed’) is
InvalidArgumentException: “mautic.customdashboard.model.embed is not a registered container key.” at ModelFactory.php .

I followed documentation and don’t know what can be the problem, anyone can help me?