text() public static méthode

public static text ( $templateData, $field )
 private function generateFields()
 {
     $fieldTemplate = $this->commandData->templatesHelper->getTemplate("field.blade", $this->viewsPath);
     $fieldsStr = "";
     foreach ($this->commandData->inputFields as $field) {
         if (!in_array($field['fieldName'], ['id', 'created_at', 'updated_at'])) {
             switch ($field['type']) {
                 case 'text':
                     $fieldsStr .= FormFieldsGenerator::text($fieldTemplate, $field) . "\n\n";
                     break;
                 case 'textarea':
                     $fieldsStr .= FormFieldsGenerator::textarea($fieldTemplate, $field) . "\n\n";
                     break;
                 case 'password':
                     $fieldsStr .= FormFieldsGenerator::password($fieldTemplate, $field) . "\n\n";
                     break;
                 case 'email':
                     $fieldsStr .= FormFieldsGenerator::email($fieldTemplate, $field) . "\n\n";
                     break;
                 case 'file':
                     $fieldsStr .= FormFieldsGenerator::file($fieldTemplate, $field) . "\n\n";
                     break;
                 case 'checkbox':
                     $fieldsStr .= FormFieldsGenerator::checkbox($fieldTemplate, $field) . "\n\n";
                     break;
                 case 'radio':
                     $fieldsStr .= FormFieldsGenerator::radio($fieldTemplate, $field) . "\n\n";
                     break;
                 case 'number':
                     $fieldsStr .= FormFieldsGenerator::number($fieldTemplate, $field) . "\n\n";
                     break;
                 case 'date':
                     $fieldsStr .= FormFieldsGenerator::date($fieldTemplate, $field) . "\n\n";
                     break;
                 case 'select':
                     $fieldsStr .= FormFieldsGenerator::select($fieldTemplate, $field) . "\n\n";
                     break;
             }
         }
     }
     $templateData = $this->commandData->templatesHelper->getTemplate("fields.blade", $this->viewsPath);
     $templateData = str_replace('$FIELDS$', $fieldsStr, $templateData);
     $fileName = "fields.blade.php";
     $path = $this->path . $fileName;
     $this->commandData->fileHelper->writeFile($path, $templateData);
     $this->commandData->commandObj->info("field.blade.php created");
 }
 private function generateFields()
 {
     $fieldTemplate = $this->commandData->templatesHelper->getTemplate('field.blade', $this->viewsPath);
     $fieldsStr = '';
     foreach ($this->commandData->inputFields as $field) {
         switch ($field['type']) {
             case 'text':
                 $fieldsStr .= FormFieldsGenerator::text($fieldTemplate, $field) . "\n\n";
                 break;
             case 'textarea':
                 $fieldsStr .= FormFieldsGenerator::textarea($fieldTemplate, $field) . "\n\n";
                 break;
             case 'password':
                 $fieldsStr .= FormFieldsGenerator::password($fieldTemplate, $field) . "\n\n";
                 break;
             case 'email':
                 $fieldsStr .= FormFieldsGenerator::email($fieldTemplate, $field) . "\n\n";
                 break;
             case 'file':
                 $fieldsStr .= FormFieldsGenerator::file($fieldTemplate, $field) . "\n\n";
                 break;
             case 'checkbox':
                 $fieldsStr .= FormFieldsGenerator::checkbox($fieldTemplate, $field) . "\n\n";
                 break;
             case 'radio':
                 $fieldsStr .= FormFieldsGenerator::radio($fieldTemplate, $field) . "\n\n";
                 break;
             case 'number':
                 $fieldsStr .= FormFieldsGenerator::number($fieldTemplate, $field) . "\n\n";
                 break;
             case 'date':
                 $fieldsStr .= FormFieldsGenerator::date($fieldTemplate, $field) . "\n\n";
                 break;
             case 'select':
                 $fieldsStr .= FormFieldsGenerator::select($fieldTemplate, $field) . "\n\n";
                 break;
         }
     }
     $templateData = $this->commandData->templatesHelper->getTemplate('fields.blade', $this->viewsPath);
     $templateData = str_replace('$FIELDS$', $fieldsStr, $templateData);
     $fileName = 'fields.blade.php';
     $path = $this->path . $fileName;
     $this->commandData->fileHelper->writeFile($path, $templateData);
     \Log::info('Admin ' . $fileName . ' Was Generated');
     $this->commandData->commandObj->info('field.blade.php created');
 }
 private function generateFields()
 {
     $fieldTemplate = '';
     $fieldsStr = '';
     $fieldsLang = '';
     foreach ($this->commandData->inputFields as $field) {
         $fieldsLang .= "'" . $field['fieldName'] . "'=>'" . Str::title(str_replace('_', ' ', $field['fieldName'])) . "',\n";
         switch ($field['type']) {
             case 'text':
                 $fieldTemplate = $this->commandData->templatesHelper->getTemplate('field.blade', $this->viewsPath);
                 $fieldsStr .= FormFieldsGenerator::text($fieldTemplate, $field) . "\n\n";
                 break;
             case 'textarea':
                 $fieldTemplate = $this->commandData->templatesHelper->getTemplate('field.blade', $this->viewsPath);
                 $fieldsStr .= FormFieldsGenerator::textarea($fieldTemplate, $field) . "\n\n";
                 break;
             case 'password':
                 $fieldTemplate = $this->commandData->templatesHelper->getTemplate('field.blade', $this->viewsPath);
                 $fieldsStr .= FormFieldsGenerator::password($fieldTemplate, $field) . "\n\n";
                 break;
             case 'email':
                 $fieldTemplate = $this->commandData->templatesHelper->getTemplate('field.blade', $this->viewsPath);
                 $fieldsStr .= FormFieldsGenerator::email($fieldTemplate, $field) . "\n\n";
                 break;
             case 'file':
                 $fieldTemplate = $this->commandData->templatesHelper->getTemplate('file.blade', $this->viewsPath);
                 $fieldsStr .= FormFieldsGenerator::file($fieldTemplate, $field) . "\n\n";
                 break;
             case 'checkbox':
                 $fieldTemplate = $this->commandData->templatesHelper->getTemplate('checkbox.blade', $this->viewsPath);
                 $fieldsStr .= FormFieldsGenerator::checkbox($fieldTemplate, $field) . "\n\n";
                 break;
             case 'radio':
                 $fieldTemplate = $this->commandData->templatesHelper->getTemplate('radio.blade', $this->viewsPath);
                 $fieldsStr .= FormFieldsGenerator::radio($fieldTemplate, $field) . "\n\n";
                 break;
             case 'number':
                 $fieldTemplate = $this->commandData->templatesHelper->getTemplate('field.blade', $this->viewsPath);
                 $fieldsStr .= FormFieldsGenerator::number($fieldTemplate, $field) . "\n\n";
                 break;
             case 'date':
                 $fieldTemplate = $this->commandData->templatesHelper->getTemplate('date.blade', $this->viewsPath);
                 $fieldsStr .= FormFieldsGenerator::date($fieldTemplate, $field) . "\n\n";
                 break;
             case 'select':
                 $fieldTemplate = $this->commandData->templatesHelper->getTemplate('field.blade', $this->viewsPath);
                 $fieldsStr .= FormFieldsGenerator::select($fieldTemplate, $field) . "\n\n";
                 break;
             case 'pointer':
                 $fieldTemplate = $this->commandData->templatesHelper->getTemplate('pointer.blade', $this->viewsPath);
                 $fieldsStr .= FormFieldsGenerator::pointer($fieldTemplate, $field) . "\n\n";
                 break;
         }
     }
     $fieldsLang .= "'save'=>'Save',\n";
     $fieldsLang .= "'cancel'=>'Cancel',\n";
     $templateData = $this->commandData->templatesHelper->getTemplate('fields.blade', $this->viewsPath);
     $templateLang = $this->commandData->templatesHelper->getTemplate('fields', $this->langsPath);
     $templateData = str_replace('$FIELDS$', $fieldsStr, $templateData);
     $templateLang = str_replace('$FIELDS_LANG$', $fieldsLang, $templateLang);
     $templateData = GeneratorUtils::fillTemplate($this->commandData->dynamicVars, $templateData);
     $templateLang = GeneratorUtils::fillTemplate($this->commandData->dynamicVars, $templateLang);
     $fileName = 'fields.blade.php';
     $path = $this->path . $fileName;
     $pathLang = $this->path_lang . str_replace('.blade', '', $fileName);
     $this->commandData->fileHelper->writeFile($path, $templateData);
     $this->commandData->commandObj->info('field.blade.php created');
     $this->commandData->fileHelper->writeFile($pathLang, $templateLang);
     $this->commandData->commandObj->info('fields.php created');
 }