xref: /plugin/struct/types/Page.php (revision 5c36a1f658576921c20b9749d01ac33724065fde)
1<?php
2namespace plugin\struct\types;
3
4/**
5 * Class Page
6 *
7 * Represents a single page in the wiki. Will be linked in output.
8 *
9 * @package plugin\struct\types
10 */
11class Page extends AbstractMultiBaseType {
12
13    /**
14     * Output the stored data
15     *
16     * @param string|int $value the value stored in the database
17     * @param \Doku_Renderer $R the renderer currently used to render the data
18     * @param string $mode The mode the output is rendered in (eg. XHTML)
19     * @return bool true if $mode could be satisfied
20     */
21    public function renderValue($value, \Doku_Renderer $R, $mode) {
22        $link = cleanID($this->config['prefix'] . $value . $this->config['postfix']);
23        if(!$link) return true;
24
25        $R->internallink(":$link");
26        return true;
27    }
28
29}
30