Back to RouterLegacy class

Method build

public array
build
(mixed &$query)
Generic build function for missing or legacy component router
Parameters
  • array & $query An array of URL arguments
Returns
  • array The URL arguments to use to assemble the subsequent URL.
Since
  • 3.3
Class: RouterLegacy
Project: Joomla

Method build - Source code

/**
 * Generic build function for missing or legacy component router
 *
 * @param   array  &$query  An array of URL arguments
 *
 * @return  array  The URL arguments to use to assemble the subsequent URL.
 *
 * @since   3.3
 */
public function build(&$query)
{
    $function = $this->component . 'BuildRoute';
    if (\function_exists($function)) {
        $segments = $function($query);
        $total = \count($segments);
        for ($i = 0; $i < $total; $i++) {
            $segments[$i] = str_replace(':', '-', $segments[$i]);
        }
        return $segments;
    }
    return array();
}