//or $data->find('something') $original = $name = array_shift($args); //we need the options $options = array_pop($args); //if it's a data lookup if (strpos($name, '$data->find(') === 0) { //this is not what we really want $name = substr($name, 12, -1); } //if it has quotes if (substr($name, 0, 1) === "'" && substr($name, -1) === "'") { //remove it $name = substr($name, 1, -1); } //get the partial $partial = \Eden\Handlebars\Runtime::getPartial($name); //but if the partial is null if (is_null($partial)) { //name is really the partial $partial = $name; } //if there are still arguments $scope = ''; if (count($args)) { $scope = '\\r\\t\\1' . $args[0] . ', '; } //form hash $hash = array(); foreach ($options['hash'] as $key => $value) { $hash[$key] = sprintf('\'%s\' => %s', $key, $value); }