protected function prepareAttributesForHtml(array $attributes) { $attributes = parent::prepareAttributesForHtml($attributes); $attributes['href'] = $this->getBaseHref(); if (array_key_exists('params', $attributes)) { if (!empty($attributes['params'])) { $attributes['href'] = $this->buildUrl(dmString::getBaseFromUrl($attributes['href']), array_merge(dmString::getDataFromUrl($attributes['href']), $attributes['params'])); /* * if last href char is a =, remove it * fixes http://github.com/diem-project/diem/issues/#issue/6 */ if ('=' === substr($attributes['href'], -1)) { $attributes['href'] = substr($attributes['href'], 0, strlen($attributes['href']) - 1); } } unset($attributes['params']); } if (isset($attributes['anchor'])) { $attributes['href'] .= '#' . $attributes['anchor']; } if (!empty($attributes['class']) && in_array('nofollow', $attributes['class'])) { $attributes['nofollow'] = true; } // makes unit testing easier ksort($attributes); return $attributes; }
protected function prepareAttributesForHtml(array $attributes) { $attributes = parent::prepareAttributesForHtml($attributes); $attributes['src'] = $this->resource->getWebPath(); return $attributes; }
protected function initialize(array $options = array()) { parent::initialize($options); $this->head = $this->body = $this->foot = array(); }