コード例 #1
0
ファイル: CodeGen.php プロジェクト: JUkhan/jwt_php
 public function getEmptyDirective($name)
 {
     $sb = new StringBuilder();
     $sb->append("class " . $name);
     $sb->appendLine();
     $sb->append("{");
     $sb->appendLine()->appendTab()->append("constructor(){");
     $sb->appendLine()->appendTab2()->append("this.restrict='E';");
     $sb->appendLine()->appendTab2()->append("this.templateUrl='Scripts/Directives/{$name}/{$name}.html';");
     $sb->appendLine()->appendTab()->append("}");
     $sb->appendLine();
     $sb->appendTab()->append("static builder()");
     $sb->appendTab()->append("{");
     $sb->appendLine();
     $sb->appendTab2()->append("return new {$name}();");
     $sb->appendLine();
     $sb->appendTab()->append("}");
     $sb->appendLine();
     $sb->append("}");
     $sb->appendLine()->append("export default {$name};");
     return $sb->toString();
 }