<?php
namespace Sintra\CMSCoreBundle;
use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
use Sintra\CMSCoreBundle\Scripts\ResourceBundle;
use Symfony\Component\HttpKernel\Config\FileLocator;
use Symfony\Component\HttpKernel\KernelInterface;
class SintraCMSCoreBundle extends AbstractPimcoreBundle implements ResourceBundle
{
private $fileLocator;
private $appKernel;
function __construct()
{
// $this->appKernel = $appKernel;
}
function boot(){
$this->appKernel=\Pimcore::getKernel();
$this->fileLocator=new FileLocator($this->appKernel);
}
function getCssFiles()
{
return [];
}
function getJSFiles()
{
$initPath = $this->fileLocator->locate('@SintraCMSCoreBundle/Resources/views/areas/js-brick/init.js');
$initScript= file_get_contents($initPath);
//include base js files
$scripts=[
//array( 'type'=>"link", 'data'=>"https://unpkg.com/vue"),
array( 'type'=>"link", 'data'=>"https://cdn.jsdelivr.net/npm/vue/dist/vue.js"),
array( 'type'=>"link", 'data'=>"https://unpkg.com/http-vue-loader@1.4.2"),
array( 'type'=>"link", 'data'=>"https://unpkg.com/vue-router@3"),
array( 'type'=>"link", 'data'=>"https://unpkg.com/vuex@4"),
array('type'=>"inline", 'data'=> $initScript)
];
return $scripts;
}
public function getJsPaths()
{
return [
'/bundles/sintracmscore/js/pimcore/startup.js'
];
}
}