Skip to content

Commit

Permalink
Merge pull request #35 from statonlab/to_lower
Browse files Browse the repository at this point in the history
convert the term name to machine readable for file names and class names
  • Loading branch information
bradfordcondon authored Mar 15, 2018
2 parents 8950d00 + 96d6f64 commit 718b164
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ public function run()
// Auto construct field name
$lower = strtolower($this->db_name);

$this->field_name = "{$lower}__{$this->cv_term}";
$term_name_machine = strtolower($this->cv_term);
$term_name_machine = str_replace(" ", "_", $term_name_machine);

$this->field_name = "{$lower}__{$term_name_machine}";
$this->questions[$this->field_name] = 'field_name';

$files = $this->generate();
Expand Down

0 comments on commit 718b164

Please sign in to comment.