예제 #1
0
 /**
  * @param FormMetadata $formMetadata
  * @return string
  */
 public function generate(FormMetadata $formMetadata)
 {
     $formMetadata->setCode($this->view->render('templates/class.php.twig', ['form' => $formMetadata]));
     $this->fileSystem->mkdir($formMetadata->classDirectory());
     $this->fileSystem->dumpFile($formMetadata->classFilename(), $formMetadata->code());
 }
예제 #2
0
 /**
  * @param FormMetadata $metadata
  * @param OutputInterface $output
  */
 public function showForm(FormMetadata $metadata, OutputInterface $output)
 {
     $output->writeln("\n<comment>{$metadata->className()} generated at:</comment>");
     $output->writeln("<info>{$metadata->classFilename()}</info>");
     $output->writeln("\n<comment>With code:</comment>");
     $output->writeln("<info>{$metadata->code()}</info>\n");
 }