Skip to content

Instantly share code, notes, and snippets.

@brusch
Created November 13, 2019 08:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brusch/73b3afda260550718298630579dc2d06 to your computer and use it in GitHub Desktop.
Save brusch/73b3afda260550718298630579dc2d06 to your computer and use it in GitHub Desktop.
Add jQuery to Pimcore admin interface
<?php
namespace AppBundle\EventListener;
use Pimcore\Event\BundleManager\PathsEvent;
use Pimcore\Event\BundleManagerEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class JqueryAdminListener implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return [
BundleManagerEvents::JS_PATHS => 'addJSFiles'
];
}
public function addJSFiles(PathsEvent $event)
{
$event->setPaths(
array_merge(
$event->getPaths(),
[
'https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js'
]
)
);
}
}
services:
AppBundle\EventListener\JqueryAdminListener: ~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment