Skip to content

Commit

Permalink
Add $MODEL_NAME_SLASH$ to GeneratorConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
handiwijoyo committed Sep 19, 2016
1 parent db10204 commit bfdccca
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Common/GeneratorConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class GeneratorConfig
public $mSnakePlural;
public $mDashed;
public $mDashedPlural;
public $mSlash;
public $mSlashPlural;
public $mHuman;
public $mHumanPlural;

Expand Down Expand Up @@ -217,6 +219,8 @@ public function loadDynamicVariables(CommandData &$commandData)
$commandData->addDynamicVariable('$MODEL_NAME_PLURAL_SNAKE$', $this->mSnakePlural);
$commandData->addDynamicVariable('$MODEL_NAME_DASHED$', $this->mDashed);
$commandData->addDynamicVariable('$MODEL_NAME_PLURAL_DASHED$', $this->mDashedPlural);
$commandData->addDynamicVariable('$MODEL_NAME_SLASH$', $this->mSlash);
$commandData->addDynamicVariable('$MODEL_NAME_PLURAL_SLASH$', $this->mSlashPlural);
$commandData->addDynamicVariable('$MODEL_NAME_HUMAN$', $this->mHuman);
$commandData->addDynamicVariable('$MODEL_NAME_PLURAL_HUMAN$', $this->mHumanPlural);

Expand Down Expand Up @@ -286,6 +290,8 @@ public function prepareModelNames()
$this->mSnakePlural = Str::snake($this->mPlural);
$this->mDashed = str_replace('_', '-', Str::snake($this->mSnake));
$this->mDashedPlural = str_replace('_', '-', Str::snake($this->mSnakePlural));
$this->mSlash = str_replace('_', '/', Str::snake($this->mSnake));
$this->mSlashPlural = str_replace('_', '/', Str::snake($this->mSnakePlural));
$this->mHuman = title_case(str_replace('_', ' ', Str::snake($this->mSnake)));
$this->mHumanPlural = title_case(str_replace('_', ' ', Str::snake($this->mSnakePlural)));
}
Expand Down

0 comments on commit bfdccca

Please sign in to comment.