| 1 | <?php |
||
| 21 | class ManiaScript implements Renderable |
||
| 22 | { |
||
| 23 | /** @var string */ |
||
| 24 | protected $filePath; |
||
| 25 | |||
| 26 | /** @var string */ |
||
| 27 | protected $id; |
||
| 28 | |||
| 29 | /** @var array */ |
||
| 30 | public $params; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * ManiaScript constructor. |
||
| 34 | * |
||
| 35 | * @param string $filePath |
||
| 36 | */ |
||
| 37 | 4 | public function __construct($filePath, $params) |
|
| 43 | |||
| 44 | /** |
||
| 45 | * Get unique variable name. |
||
| 46 | * |
||
| 47 | * @param string $name |
||
| 48 | * |
||
| 49 | * @return string |
||
| 50 | */ |
||
| 51 | 1 | public function getVarN($name) |
|
| 55 | |||
| 56 | /** |
||
| 57 | * Generate script content |
||
| 58 | * |
||
| 59 | * @return string |
||
| 60 | */ |
||
| 61 | 2 | public function __toString() |
|
| 78 | |||
| 79 | /** |
||
| 80 | * Render the XML element |
||
| 81 | * |
||
| 82 | * @param \DOMDocument $domDocument DOMDocument for which the XML element should be rendered |
||
| 83 | * |
||
| 84 | * @return \DOMElement |
||
| 85 | */ |
||
| 86 | 2 | public function render(\DOMDocument $domDocument) |
|
| 96 | } |