1 <?php
2 /**
3 * @package Joomla.Libraries
4 * @subpackage Component
5 *
6 * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
7 * @license GNU General Public License version 2 or later; see LICENSE.txt
8 */
9
10 defined('JPATH_PLATFORM') or die;
11
12 /**
13 * Component routing interface
14 *
15 * @since 3.3
16 */
17 interface JComponentRouterInterface
18 {
19 /**
20 * Prepare-method for URLs
21 * This method is meant to validate and complete the URL parameters.
22 * For example it can add the Itemid or set a language parameter.
23 * This method is executed on each URL, regardless of SEF mode switched
24 * on or not.
25 *
26 * @param array $query An associative array of URL arguments
27 *
28 * @return array The URL arguments to use to assemble the subsequent URL.
29 *
30 * @since 3.3
31 */
32 public function preprocess($query);
33
34 /**
35 * Build method for URLs
36 * This method is meant to transform the query parameters into a more human
37 * readable form. It is only executed when SEF mode is switched on.
38 *
39 * @param array &$query An array of URL arguments
40 *
41 * @return array The URL arguments to use to assemble the subsequent URL.
42 *
43 * @since 3.3
44 */
45 public function build(&$query);
46
47 /**
48 * Parse method for URLs
49 * This method is meant to transform the human readable URL back into
50 * query parameters. It is only executed when SEF mode is switched on.
51 *
52 * @param array &$segments The segments of the URL to parse.
53 *
54 * @return array The URL attributes to be used by the application.
55 *
56 * @since 3.3
57 */
58 public function parse(&$segments);
59 }
60