neilime/zf2-assets-bundle

Deprecated when trying to add custom JS

wambaloo opened this issue · 2 comments

Hi !!

There is a deprecated notice when trying to include custom JS in header.

Deprecated: You are retrieving the service locator from within the class Entities\Controller\IndexController. Please be aware that ServiceLocatorAwareInterface is deprecated and will be removed in version 3.0, along with the ServiceLocatorAwareInitializer. You will need to update your class to accept all dependencies at creation, either via constructor arguments or setters, and use a factory to perform the injections. in C:\wamp64\www\pdl\vendor\zendframework\zend-mvc\src\Controller\AbstractController.php on line 258

when trying to do that in header (like documentation suggest) :

if(is_array($this->jsCustomFiles))foreach($this->jsCustomFiles as $sJsCustomFile){ $this->plugin('InlineScript')->appendFile($sJsCustomFile); }

Maybe I missed something ?

Thanks in advance and thanks for this ZF2 module !!

Hi,

The very last version should fix your issue

Nice work !!! thank you very much ! I will open a new ticket I think I found a new bug ;)