<?php
namespace Moto\ClickAction; use Moto; use Website; use Zend; class Taxonomy extends Moto\ClickAction\AbstractClickAction { protected $_url; public function getUrl() { $anchor = $this->get('anchor'); if (!empty($anchor)) { $anchor = trim($anchor); $anchor = trim($anchor, '#'); $anchor = '#' . $anchor; } if ($this->_url === null) { try { $taxonomy = Moto\Database\ContentTaxonomy::find($this->get('id')); $url = Moto\Website\BlogApplication::getRelativeUrl($taxonomy); if (!$url) { $url = $this->get('fallback', ''); } $this->_url = $url; } catch (\Exception $e) { $this->_url = $this->get('fallback', ''); } } return $this->_url . $anchor; } } 