1 <?php
 2 
 3 /**
 4  * REX_PROPERTY[key=xzy].
 5  *
 6  * Arguments:
 7  *   - key
 8  *   - namespace
 9  *
10  * @author gharlan
11  *
12  * @package redaxo\core
13  */
14 class rex_var_property extends rex_var
15 {
16     /**
17      * {@inheritdoc}
18      */
19     protected function getOutput()
20     {
21         $key = $this->getParsedArg('key', null, true);
22         if ($key === null) {
23             return false;
24         }
25         $namespace = $this->getParsedArg('namespace');
26         $base = $namespace ? 'rex_package::get(' . $namespace . ')->' : 'rex::';
27         return 'htmlspecialchars(' . $base . 'getProperty(' . $key . '))';
28     }
29 }
30