Exemplo n.º 1
0
 /**
  * Get an asset relative to this extension's directory.
  * @param Assets $assets Assets module.
  * @param string $path A relative path.
  * @return string An asset path.
  */
 public function getAsset(Assets $assets, $path)
 {
     list($key, $path) = $this->getKeyPath($path);
     return $assets->getAsset($key, $path);
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function getIcon($icon, $size = 16)
 {
     $file = $this->assets->getAsset($this->dir . '/' . $icon . '.png');
     return '<img src="' . $file . '" alt="' . $icon . '" width="' . $size . '" height="' . $size . '" />';
 }