title = $title; $this->url = $url; $this->controller = $controller; $this->priority = $priority; parent::__construct(); } /** * @param array $attributes */ public function setAttributes($attributes) { $this->attributes = $attributes; } /** * @param array * * @return HTML */ public function getAttributesHTML($attrs = null) { $exclude = (is_string($attrs)) ? func_get_args() : null; if(!$attrs || is_string($attrs)) { $attrs = $this->attributes; } // Remove empty $attrs = array_filter((array)$attrs, function($v) { return ($v || $v === 0 || $v === '0'); }); // Create markkup $parts = array(); foreach($attrs as $name => $value) { $parts[] = ($value === true) ? "{$name}=\"{$name}\"" : "{$name}=\"" . Convert::raw2att($value) . "\""; } return implode(' ', $parts); } }