public function field($name) { $path = explode('.', $name); return array_shift($path) . ($path ? '[' . implode('][', $path) . ']' : ''); }