Appzcoder\CrudGenerator\Commands\CrudLangCommand::templateVars PHP Метод

templateVars() приватный Метод

Translate form's fields.
private templateVars ( string $newLangFile ) : void
$newLangFile string
Результат void
    private function templateVars($newLangFile)
    {
        $messages = [];
        foreach ($this->formFields as $field) {
            $index = $field['name'];
            $text = ucwords(strtolower(str_replace('_', ' ', $index)));
            $messages[] = "'{$index}' => '{$text}'";
        }
        File::put($newLangFile, str_replace('%%messages%%', implode(",\n", $messages), File::get($newLangFile)));
    }