bundles/Sintra/CMSCoreBundle/SintraCMSCoreBundle.php line 11

Open in your IDE?
  1. <?php
  2. namespace Sintra\CMSCoreBundle;
  3. use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
  4. use Sintra\CMSCoreBundle\Scripts\ResourceBundle;
  5. use Symfony\Component\HttpKernel\Config\FileLocator;
  6. use Symfony\Component\HttpKernel\KernelInterface;
  7. class SintraCMSCoreBundle extends AbstractPimcoreBundle implements ResourceBundle
  8. {
  9.     private $fileLocator;
  10.     private $appKernel;
  11.     function __construct()
  12.     {
  13.        // $this->appKernel = $appKernel;
  14.        
  15.     }
  16.     function boot(){
  17.         $this->appKernel=\Pimcore::getKernel();
  18.         $this->fileLocator=new FileLocator($this->appKernel);
  19.     }
  20.     
  21.     function  getCssFiles()
  22.     {
  23.         return [];
  24.     }
  25.     function  getJSFiles()
  26.     {
  27.         $initPath $this->fileLocator->locate('@SintraCMSCoreBundle/Resources/views/areas/js-brick/init.js');
  28.         $initScriptfile_get_contents($initPath);
  29.         //include base js files
  30.         $scripts=[
  31.             //array( 'type'=>"link", 'data'=>"https://unpkg.com/vue"),
  32.         array( 'type'=>"link"'data'=>"https://cdn.jsdelivr.net/npm/vue/dist/vue.js"),
  33.         array( 'type'=>"link"'data'=>"https://unpkg.com/http-vue-loader@1.4.2"),
  34.         array( 'type'=>"link"'data'=>"https://unpkg.com/vue-router@3"),
  35.         array( 'type'=>"link"'data'=>"https://unpkg.com/vuex@4"),
  36.         array('type'=>"inline"'data'=> $initScript)
  37.        ];
  38.        return $scripts;
  39.     }
  40.     
  41.     public function getJsPaths()
  42.     {
  43.         return [
  44.             '/bundles/sintracmscore/js/pimcore/startup.js'
  45.         ];
  46.     }
  47. }