Exemplo n.º 1
0
 /**
  * Test creating an asset Loader
  */
 public function testLoadingRemoteAsset()
 {
     $item = new core_kernel_classes_Resource('toto');
     $loader = new Loader($item);
     $result = $loader->getAssetContent('http://domain.tld/foo.css');
     $this->assertEquals(null, $result);
 }
Exemplo n.º 2
0
 public function getAsset()
 {
     $item = new \core_kernel_classes_Resource($this->getRequestParameter('id'));
     $assetPath = $this->getRequestParameter('asset');
     $mimeType = \tao_helpers_File::getMimeType($assetPath, true);
     header('Content-Type: ' . $mimeType);
     $loader = new Loader($item);
     $content = $loader->getAssetContent($assetPath);
     echo $content;
 }