protected function confirmedTitle(Form $form, Field $field, $property) { $fieldName = $field->getName(); // If in some lang file the confirmation key is excplicit setted if ($directHit = $this->getFirstMatch($this->relativeKey($form, $field, $property))) { return $directHit; } // Otherwise try to translate the confirmation text with the source field // name // If no confirm key setted break if (!($confirmKey = $this->getFirstMatchedKey("forms.base.field_confirmed"))) { return; } $sourceFieldName = str_replace('_confirmation', '', $fieldName); $sourceRelativeKey = $this->relativeKey($form, $form->get($sourceFieldName), $property); // If the source field is not named break if (!($sourceTitle = $this->getFirstMatch($sourceRelativeKey))) { return; } return $this->lang->get($confirmKey, ['attribute' => $sourceTitle]); }
public function isLastField(Field $field) { $last = count($this->keyOrder) - 1; if (isset($this->keyOrder[$last])) { if ($this->keyOrder[$last] == $field->getName()) { return TRUE; } } return FALSE; }
protected function fieldKey(Field $field) { return str_replace('__', '.', $field->getName()); }
protected function getCacheId(Form $form, Field $field, $property) { return $form->getName() . '|' . $field->getName() . "|{$property}"; }
public function getAction() { if ($this->form) { return $this->form->getName() . '_' . parent::getName(); } }