Ejemplo n.º 1
0
 /**
  * Renders a command as a link tag. If it has a href, it will use the route to Route the link.
  *
  * @param ComBaseControllerToolbarCommand $command Command to render as a link
  *
  * @return string
  */
 public function command($command)
 {
     $attributes = KConfig::unbox($command->getAttributes());
     if (isset($attributes['icon'])) {
         $icon = 'icon-' . $attributes['icon'];
         $command->label = '<i class="' . $icon . '"></i>&nbsp;' . $command->label;
         unset($attributes['icon']);
     }
     $html = $this->getService('com:base.template.helper.html');
     return (string) $html->tag('a', $command->label, $attributes);
 }