Generate the controller with updated template.
492638
public function generate()
    {
        /*write operation ->*/
        $writeTmp = fopen(
            $this->applicationDir.DS.'Controllers'.DS.$this->controller.'Controller'.EXT,
            'w'
        ) or die('Unable to generate controller');

        $contentAppendWith = '<?php '.PHP_EOL;

        fwrite($writeTmp, $contentAppendWith.$this->replacedContent);
        fclose($writeTmp);
        fclose($this->filePointer);
    }
1252214
private function generateTemplate()
    {
        $relPath = '/Resources/views/';
        $this->renderFiles(
            $this->skeletonDir . $relPath,
            $this->getTemplateDir($this->bundle),
            array('bundle' => $this->bundle, 'demosite' => $this->demosite, 'shortBundleName' => $this->shortBundleName, 'isV4' => $this->isSymfony4()),
            true
        );

        if (!$this->demosite) {
            // Layout
            $this->removeFile($this->getTemplateDir($this->bundle) . '/Layout/_mobile-nav.html.twig');
            $this->removeFile($this->getTemplateDir($this->bundle) . '/Layout/_demositemessage.html.twig');
        }

        $this->assistant->writeLine('Generating template files : <info>OK</info>');
    }
1272125
public function run()
    {
        // Creates the current controller instance
        $this->controller = new $this->controller($this->twig);

        // Calls the action method on the controller
        $response = call_user_func([$this->controller, $this->action]);

        // Shows the response
        echo $response;
    }
518120
function templateSourceUpdate(){
    if (this.destroyBuilder)
      buildTemplate.call(this);

    var cursor = this;
    while (cursor = cursor.attaches_)
      cursor.handler.call(cursor.context);
  }
9605
function generateDemoHtml(done) {
			if (!o.htmlDemo) {
				done();
				return;
			}

			var context = prepareHtmlTemplateContext();

			// Generate HTML
			var demoTemplate = readTemplate(o.htmlDemoTemplate, 'demo', '.html');
			var demo = renderTemplate(demoTemplate, context);

			mkdirp(getDemoPath(), function(err) {
				if (err) {
					logger.log(err);
					return;
				}
				// Save file
				fs.writeFileSync(getDemoFilePath(), demo);
				done();
			});

		}
837256
def generate(*args)
      init_vars(options)

      controller = args.shift
      actions = args

      if controller
        sanitize(controller, actions, options)
      else
        puts "Please provide a controller name."
        exit
      end
    end
562898
protected void generateRoutes()
    {
        try {

//			Optional<io.sinistral.proteus.annotations.Chain> typeLevelWrapAnnotation = Optional.ofNullable(controllerClass.getAnnotation(io.sinistral.proteus.annotations.Chain.class));
//			
//			typeLevelWrapAnnotation.ifPresent( a -> {
//				 
//				io.sinistral.proteus.annotations.Chain w = typeLevelWrapAnnotation.get();
//
//				Class<? extends HandlerWrapper> wrapperClasses[] = w.value();
//
//				for (int i = 0; i < wrapperClasses.length; i++)
//				{
//					Class<? extends HandlerWrapper> wrapperClass = wrapperClasses[i];
//
//					String wrapperName = generateFieldName(wrapperClass.getCanonicalName());
//
//					handlerWrapperMap.put(wrapperClass, wrapperName);
//				}
//				
//			});
//			
//			for(Method m : this.controllerClass.getDeclaredMethods())
//			{
//			
//				Optional<io.sinistral.proteus.annotations.Chain> methodLevelWrapAnnotation = Optional.ofNullable(m.getAnnotation(io.sinistral.proteus.annotations.Chain.class));
//				
//				methodLevelWrapAnnotation.ifPresent( a -> {
//					 
//					io.sinistral.proteus.annotations.Chain w = methodLevelWrapAnnotation.get();
//	
//					Class<? extends HandlerWrapper> wrapperClasses[] = w.value();
//	
//					for (int i = 0; i < wrapperClasses.length; i++)
//					{
//						Class<? extends HandlerWrapper> wrapperClass = wrapperClasses[i];
//	
//						String wrapperName = generateFieldName(wrapperClass.getCanonicalName());
//	
//						handlerWrapperMap.put(wrapperClass, wrapperName);
//					}
//					
//				});
//
//			}
//			
//			log.info("handlerWrapperMap: " + handlerWrapperMap);

            TypeSpec.Builder typeBuilder = TypeSpec.classBuilder(className).addModifiers(Modifier.PUBLIC)
                    .addSuperinterface(ParameterizedTypeName.get(Supplier.class, RoutingHandler.class));

            ClassName extractorClass = ClassName.get("io.sinistral.proteus.server", "Extractors");

            ClassName injectClass = ClassName.get("com.google.inject", "Inject");


            MethodSpec.Builder constructor = MethodSpec.constructorBuilder().addModifiers(Modifier.PUBLIC).addAnnotation(injectClass);

            String className = this.controllerClass.getSimpleName().toLowerCase() + "Controller";

            typeBuilder.addField(this.controllerClass, className, Modifier.PROTECTED, Modifier.FINAL);

            ClassName wrapperClass = ClassName.get("io.undertow.server", "HandlerWrapper");
            ClassName stringClass = ClassName.get("java.lang", "String");
            ClassName mapClass = ClassName.get("java.util", "Map");

            TypeName mapOfWrappers = ParameterizedTypeName.get(mapClass, stringClass, wrapperClass);

            TypeName annotatedMapOfWrappers = mapOfWrappers
                    .annotated(AnnotationSpec.builder(com.google.inject.name.Named.class).addMember("value", "$S", "registeredHandlerWrappers").build());

            typeBuilder.addField(mapOfWrappers, "registeredHandlerWrappers", Modifier.PROTECTED, Modifier.FINAL);


            constructor.addParameter(this.controllerClass, className);
            constructor.addParameter(annotatedMapOfWrappers, "registeredHandlerWrappers");

            constructor.addStatement("this.$N = $N", className, className);
            constructor.addStatement("this.$N = $N", "registeredHandlerWrappers", "registeredHandlerWrappers");

            addClassMethodHandlers(typeBuilder, this.controllerClass);

            typeBuilder.addMethod(constructor.build());

            JavaFile javaFile = JavaFile.builder(packageName, typeBuilder.build()).addStaticImport(extractorClass, "*").build();

            StringBuilder sb = new StringBuilder();

            javaFile.writeTo(sb);

            this.sourceString = sb.toString();

        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }
    }
1108256
def generate(options = {})
      res = @template.result(options)
      resource_schema = JSON.parse(res)
      schema = Prmd::Schema.new
      schema.merge!(@base)
      schema.merge!(resource_schema)
      schema
    end
572783
public function generateController()
    {
        if (!$this->confirm('Do you want to generate a controller?')) {
            return;
        }

        $this->console->call('generate:controller', [
            'name' => $this->getControllerName(),
            '--force' => $this->console->option('force'),
            '--scaffold' => true,
        ]);
    }
1357726
private function publishAppBaseController()
    {
        $templateHelper = new TemplatesHelper();
        $templateData = $templateHelper->getTemplate('AppBaseController', 'controller');

        $templateData = GeneratorUtils::fillTemplate(CommandData::getConfigDynamicVariables(), $templateData);

        $fileName = 'AppBaseController.php';

        $filePath = Config::get('generator.path_controller', app_path('Http/Controllers/'));

        $fileHelper = new FileHelper();
        $fileHelper->writeFile($filePath.$fileName, $templateData);
        $this->comment('AppBaseController generated');
        $this->info($fileName);
    }
972029
def controller_creatr(filename):
    """"""
    if not check():
        click.echo(Fore.RED + 'ERROR: Ensure you are in a bast app to run the create:controller command')
        return

    path = os.path.abspath('.') + '/controller'
    if not os.path.exists(path):
        os.makedirs(path)

    # if os.path.isfile(path + )

    file_name = str(filename + '.py')
    if os.path.isfile(path+"/" + file_name):
        click.echo(Fore.WHITE + Back.RED + "ERROR: Controller file exists")
        return
    controller_file = open(os.path.abspath('.') + '/controller/' + file_name, 'w+')
    compose = "from bast import Controller\n\nclass " + filename + "(Controller):\n    pass"
    controller_file.write(compose)
    controller_file.close()
    click.echo(Fore.GREEN + "Controller " + filename + " created successfully")
1330913
function generateController(_path, config) {
  if(config.controller === null) {
    delete config.controller;
    config.generated = true;
    return config;
  }

  config.action = getAction(_path+config.controller, config.action);
  delete config.controller;
  config.generated = true;
  return config;
}
551239
private function createController(): void
    {
        $aFields  = $this->getArguments();
        $aCreated = [];

        try {

            $aClasses = array_filter(explode(',', $aFields['CLASS_NAME']));

            foreach ($aClasses as $sClass) {

                $aFields['CLASS_NAME'] = $sClass;
                $this->oOutput->write('Creating controller <comment>' . $sClass . '</comment>... ');

                //  Check for existing controller
                $sPath = static::CONTROLLER_PATH . $sClass . '.php';
                if (file_exists($sPath)) {
                    throw new ControllerExistsException(
                        'Controller "' . $sClass . '" exists already at path "' . $sPath . '"'
                    );
                }

                $this->createFile($sPath, $this->getResource('template/controller.php', $aFields));
                $aCreated[] = $sPath;
                $this->oOutput->writeln('<info>done!</info>');
            }

        } catch (\Exception $e) {
            $this->oOutput->writeln('<error>failed!</error>');
            //  Clean up created models
            if (!empty($aCreated)) {
                $this->oOutput->writeln('<error>Cleaning up - removing newly created controllers</error>');
                foreach ($aCreated as $sPath) {
                    @unlink($sPath);
                }
            }
            throw $e;
        }
    }
635049
private function generateController()
    {
        // Figure out the naming
        $controller = Str::plural(ucfirst($this->argument('model')));
        $path = 'app/Http/Controllers/Admin/'.$controller.'.php';
        $file = base_path().'/'.$path;

        // Copy the stub over
        if (!file_exists(dirname($file))) {
            mkdir(dirname($file), 0744, true);
        }
        if (file_exists($file)) {
            return $this->comment('Controller already exists: '.$path);
        }
        file_put_contents($file, str_replace('{{controller}}', $controller, file_get_contents($this->stubs.'/controller.stub')));
        $this->info('Controller created: '.$path);
    }
1197040
function generateDirective(originalName) {
    var template = args.t || args.template || "html";
    var name = originalName.split("/").pop();
    var obj = {
        name: name,
        original_name: originalName,
        template_extension: template,
    };
    var gen = {
        json: templates.generator.config(),
        js: templates.generator.js(),
        scss: templates.generator.scss(),
    };

    gen[template] = templates.generator[template]();

    return Object.keys(gen).reduce(function (files, ext) {
        files[originalName + "/" + name + "." + ext] = replaceText(gen[ext], obj);
        return files;
    }, {});
}
1372196
function () {
      if (this.edirty) {
          var en=this.attEltNodes;
          if (en) {
              for (var i=0,sz=en.length; sz>i; i++) {
                  en[i].refresh();
              }
              // if content changed we have to rebuild childElements
              this.retrieveAttElements();
              this.initChildComponents();
          }
          // Change content of the controller
          json.set(this.controller,"$content",this.getControllerContent());

          this.edirty=false;
      }
      // warning: the following refresh may change the component type and
      // as such ctlWrapper could become null if new component is a template
      $CptNode.refresh.call(this);
      if (this.ctlWrapper) {
        // refresh cpt through $refresh if need be
        this.ctlWrapper.refresh();
      }
  }
755666
public function generate($controller)
    {
        if (!$controller instanceof Controller) {
            $controller = new $controller('', null);
        }
        $this->controller = get_class($controller);
        $this->admin = $controller->admin;
        $this->title = $controller->name;
        $this->description = $controller->description;
    }