Remove unused variable in ProfilerMwprof
[mediawiki.git] / includes / title / PageLinkRenderer.php
blobfb1096e0fa194fb9c1c422f15be45d454fdb6a14
1 <?php
2 /**
3 * Represents a link rendering service for %MediaWiki.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
20 * @file
21 * @license GPL 2+
22 * @author Daniel Kinzler
25 /**
26 * Represents a link rendering service for %MediaWiki.
28 * This is designed to encapsulate the knowledge about how page titles map to
29 * URLs, and how links are encoded in a given output format.
31 * @see https://www.mediawiki.org/wiki/Requests_for_comment/TitleValue
33 interface PageLinkRenderer {
34 /**
35 * Returns the URL for the given page.
37 * @todo expand this to cover the functionality of Linker::linkUrl
39 * @param TitleValue $page The link's target
40 * @param array $params Any additional URL parameters.
42 * @return string
44 public function getPageUrl( TitleValue $page, $params = array() );
46 /**
47 * Returns an HTML link to the given page, using the given surface text.
49 * @todo expand this to cover the functionality of Linker::link
51 * @param TitleValue $page The link's target
52 * @param string $text The link's surface text (will be derived from $page if not given).
54 * @return string
56 public function renderHtmlLink( TitleValue $page, $text = null );
58 /**
59 * Returns a wikitext link to the given page, using the given surface text.
61 * @param TitleValue $page The link's target
62 * @param string $text The link's surface text (will be derived from $page if not given).
64 * @return string
66 public function renderWikitextLink( TitleValue $page, $text = null );