xref: /plugin/struct/types/Text.php (revision 7234bfb14e712ff548d9266ef32fdcc8eaf2d04e)
1<?php
2
3namespace dokuwiki\plugin\struct\types;
4
5class Text extends AbstractMultiBaseType
6{
7    use TraitFilterPrefix;
8
9    protected $config = ['prefix' => '', 'postfix' => ''];
10
11    /**
12     * Output the stored data
13     *
14     * @param string|int $value the value stored in the database
15     * @param \Doku_Renderer $R the renderer currently used to render the data
16     * @param string $mode The mode the output is rendered in (eg. XHTML)
17     * @return bool true if $mode could be satisfied
18     */
19    public function renderValue($value, \Doku_Renderer $R, $mode)
20    {
21        $R->cdata($this->config['prefix'] . $value . $this->config['postfix']);
22        return true;
23    }
24}
25