controller()->url($action, $params); } /** * Retrieve base url * * @return string */ public function baseUrl() { return str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME'])); } /** * Retrieve url of magento * * @return string */ public function mageUrl() { return str_replace('\\', '/', dirname($this->baseUrl())); } /** * Include template * * @param string $name * @return string */ public function template($name) { ob_start(); include $this->controller()->filepath('template/'.$name); return ob_get_clean(); } /** * Set value for key * * @param string $key * @param mixed $value * @return Maged_Controller */ public function set($key, $value) { $this->_data[$key] = $value; return $this; } /** * Get value by key * * @param string $key * @return mixed */ public function get($key) { return isset($this->_data[$key]) ? $this->_data[$key] : null; } /** * Translator * * @param string $string * @return string */ public function __($string) { return $string; } /** * Retrieve link for header menu * * @param mixed $action */ public function getNavLinkParams($action) { $params = 'href="'.$this->url($action).'"'; if ($this->controller()->getAction()==$action) { $params .= ' class="active"'; } return $params; } /** * Retrieve Session Form Key * * @return string */ public function getFormKey() { return $this->controller()->getFormKey(); } }