Selaa lähdekoodia

Change label for "Name" field

Alan Lam 3 vuotta sitten
vanhempi
commit
e97083893f
1 muutettua tiedostoa jossa 9 lisäystä ja 1 poistoa
  1. 9 1
      views/entity_form.php

+ 9 - 1
views/entity_form.php

@@ -15,6 +15,14 @@ $is_company = $model instanceof Company;
 $is_customer = $model instanceof Customer;
 $is_location = $model instanceof Location;
 
+$name_label = "Name";
+if($is_company || $is_customer) {
+	$name_label = "Company Name";
+}
+if($is_location) {
+	$name_label = "Location Name";
+}
+
 ?>
 <h3><?=htmlspecialchars($title)?></h3>
 
@@ -53,7 +61,7 @@ $is_location = $model instanceof Location;
 			?>
 
 			<div class="mb-3">
-				<label class="form-label" for="name"><?=htmlspecialchars(__("Name"))?></label>
+				<label class="form-label" for="name"><?=htmlspecialchars($name_label)?></label>
 				<input class="form-control" type="text" id="name" name="name" placeholder="<?=htmlspecialchars(__("Type name"))?>" value="<?=htmlspecialchars($model->name)?>" required />
 			</div>