Skip to content

Commit

Permalink
removed method
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel committed Nov 30, 2024
1 parent cdcedee commit b7063d9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 91 deletions.
47 changes: 0 additions & 47 deletions app/code/core/Mage/Core/Controller/Front/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,51 +52,4 @@ public function addRoutes(Zend_Controller_Router_Interface $router)

return $this;
}

/**
* @param string|array $params
* @return string
- */
public function getUrl($params = [])
{
static $reservedKeys = ['module' => 1, 'controller' => 1, 'action' => 1, 'array' => 1];

if (is_string($params)) {
$paramsArr = explode('/', $params);
$params = ['controller' => $paramsArr[0], 'action' => $paramsArr[1]];
}

$url = Mage::getBaseUrl();

if (!empty($params['frontName'])) {
$url .= $params['frontName'] . '/';
} else {
$url .= $this->_config->getName() . '/';
}

if (!empty($params)) {
$paramsStr = '';
foreach ($params as $key => $value) {
if (!isset($reservedKeys[$key]) && $key[0] !== '_' && !empty($value)) {
$paramsStr .= $key . '/' . $value . '/';
}
}

if (empty($params['controller']) && !empty($paramsStr)) {
$params['controller'] = 'index';
}
$url .= empty($params['controller']) ? '' : $params['controller'] . '/';

if (empty($params['action']) && !empty($paramsStr)) {
$params['action'] = 'index';
}
$url .= empty($params['action']) ? '' : $params['action'] . '/';

$url .= $paramsStr;

$url .= empty($params['array']) ? '' : '?' . http_build_query($params['array']);
}

return $url;
}
}
44 changes: 0 additions & 44 deletions tests/unit/Mage/Core/Controller/Front/RouterTest.php

This file was deleted.

0 comments on commit b7063d9

Please sign in to comment.