getJsFiles() 공개 메소드

public getJsFiles ( $locale )
예제 #1
0
파일: ClientAction.php 프로젝트: kidaa/core
 /**
  * Set up the locale compiler for the given locale.
  *
  * @param string $locale
  * @return LocaleJsCompiler
  */
 protected function getLocaleCompiler($locale)
 {
     $compiler = new LocaleJsCompiler($this->getAssetDirectory(), "{$this->clientName}-{$locale}.js");
     foreach ($this->locales->getJsFiles($locale) as $file) {
         $compiler->addFile($file);
     }
     return $compiler;
 }
예제 #2
0
 /**
  * @param string $layout
  * @param WebAppAssets $assets
  * @param Client $api
  * @param Factory $view
  * @param LocaleManager $locales
  * @param AbstractSerializer $userSerializer
  */
 public function __construct($layout, WebAppAssets $assets, Client $api, Factory $view, LocaleManager $locales, AbstractSerializer $userSerializer)
 {
     $this->layout = $layout;
     $this->api = $api;
     $this->assets = $assets;
     $this->view = $view;
     $this->locales = $locales;
     $this->userSerializer = $userSerializer;
     $this->addHeadString('<link rel="stylesheet" href="//fonts.css.network/css?family=Open+Sans:400italic,700italic,400,700,600">', 'font');
     $this->js = $this->assets->getJs();
     $this->css = $this->assets->getCss();
     $locale = $this->locales->getLocale();
     $this->localeJs = $this->assets->getLocaleJs($locale);
     $this->localeCss = $this->assets->getLocaleCss($locale);
     foreach ($this->locales->getJsFiles($locale) as $file) {
         $this->localeJs->addFile($file);
     }
     foreach ($this->locales->getCssFiles($locale) as $file) {
         $this->localeCss->addFile($file);
     }
 }