isConstant()) { $value = $this->base->getValue(); $exp = ''; foreach (array_keys($this->parameters) as $i) { $exp .= $this->parameters[$i]->getValue(); } return math_filter($value, $exp, $this->location_in_template->getFile(), $this->location_in_template->getLine()); } else { $this->raiseUnresolvedBindingError(); } } /** * Generate the code to read the data value at run time * Must generate only a valid PHP Expression. * @param WactCodeWriter * @return void */ function generateExpression($code_writer) { $code_writer->registerInclude('limb/wact/src/components/data/math_filter.inc.php'); $code_writer->writePHP('math_filter('); $this->base->generateExpression($code_writer); $code_writer->writePHP(','); $first = true; foreach (array_keys($this->parameters) as $i) { if (!$first) { $code_writer->writePHP('.'); } else { $first = false; } $this->parameters[$i]->generateExpression($code_writer); } $code_writer->writePHP(','); $code_writer->writePHPLiteral($this->location_in_template->getFile()); $code_writer->writePHP(','); $code_writer->writePHPLiteral($this->location_in_template->getLine()); $code_writer->writePHP(')'); } } ?>