false, 'sourceContent' => $this->renderScript('Form'), ]; } protected function renderScript($name) { $content = file_get_contents(__DIR__ . '/ObjName.js'); $parts = explode('\\', $this->_getNameSpace()); array_shift($parts); $parts = array_map('lcfirst', $parts); $objNamespace = implode('.', $parts); $content = str_replace('objNamespace', $objNamespace, $content); $content = str_replace('ObjName', $name, $content); return $content; } }