<?php
 class vB_Utility_Template_ParserNode_Curly_Js extends vB_Utility_Template_ParserNode_Curly { public function validate() : array { $errors = []; $attributecount = sizeof($this->main_node->attributes); if ($attributecount == 0) { $errors[] = 'no_variable_specified'; } return $errors; } public function compile() : string { $arguments = []; foreach ($this->main_node->attributes AS $attribute) { if ($attribute instanceof vB_CurlyNode) { $attribute = $this->attributeToString($attribute); } else { } $arguments[] = "'" . $attribute . "'"; } if (!empty($arguments) AND ($arguments[0] == "'insert_here'" OR $arguments[0] == "'1'")) { return 'vB_Template_Runtime::includeJs(' . implode(', ', $arguments) . '); $final_rendered .= \'\''; } return '\'\'; vB_Template_Runtime::includeJs(' . implode(', ', $arguments) . '); $final_rendered .= \'\''; } } 