<?php
 class vB_Utility_Template_ParserNode_Curly_Compilesearch extends vB_Utility_Template_ParserNode_Curly { public function validate() : array { $errors = []; $attributecount = sizeof($this->main_node->attributes); if ($attributecount == 0) { $errors[] = 'no_searchstring_specified'; } if ($attributecount < 2) { $errors[] = 'too_few_attributes'; } return $errors; } public function compile() : string { $attributes = $this->getRenderedAttributes(); $searchJSON = array_shift($attributes); $arguments = '[' . implode(', ', $attributes) . ']'; return 'vB_Template_Runtime::parseJSON(' . $searchJSON . ',' . $arguments . ')'; } } 