/** * @param CssAsset $asset * @return mixed * @throws HelperMethodNotFoundException */ public function renderCss(CssAsset $asset) { $helper = $this->helpers[$this->assetTypes['css']['helper']]; if (!is_a($helper, 'Helper') || !method_exists($helper, 'css')) { throw new HelperMethodNotFoundException(); } return $helper->css($asset->getPath(), $asset->getRel(), array('inline' => TRUE)); }
public function testContentIncludePlugin() { $this->Asset = CssAsset::fromUrl('css/plugin.css', $this->path); $expected = <<<EOT @import "/asset/other/css/bundle-910318eb7938fd444cf06516ce70b8d1.css"; body { /* plugin.css */ } EOT; $this->assertEquals($expected, $this->Asset->content()); }
public function fromUrl($url, $env = null) { $info = pathinfo($url); if ($info['extension'] == 'css') { return CssAsset::fromUrl($url, $env); } if ($info['extension'] == 'js') { return JsAsset::fromUrl($url, $env); } return StaticAsset::fromUrl($url, $env); }