/** * Returns a specific helper * * @param *string $name The name of the helper * * @return function|null */ public function getHelper($name) { return Runtime::getHelper($name); }
/** * Calls an alternative helper to add on to the compiled code * * @param *array $node * * @return string|false */ protected function tokenize($node) { //lookout for pre processors helper $value = explode(' ', $node['value']); //is it a helper ? $helper = Runtime::getHelper('tokenize-' . $value[0]); if (!$helper) { return false; } list($name, $args, $hash) = $this->parseArguments($node['value']); //options $args[] = array('node' => $node, 'name' => $name, 'args' => $node['value'], 'hash' => $hash, 'offset' => $this->offset, 'handlebars' => $this->handlebars); //NOTE: Tokenized do not have data binded to it return call_user_func_array($helper, $args); }