<?php
 class vB_Utility_Template_ParserNode_Curly_Customstylevar extends vB_Utility_Template_ParserNode_Curly { public function validate() : array { $errors = []; $attributecount = sizeof($this->main_node->attributes); if ($attributecount == 0) { $errors[] = 'no_variable_specified'; } if ($attributecount > 2) { $errors[] = 'too_many_attributes'; } return $errors; } public function compile() : string { $user = ''; if (!empty($this->main_node->attributes[1])) { $user = ', ' . $this->attributeToString($this->main_node->attributes[1]); } return 'vB_Template_Runtime::fetchCustomStylevar("' . $this->main_node->attributes[0] . '"' . $user . ')'; } } 