コード例 #1
0
 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]);
 }
コード例 #2
0
ファイル: FieldList.php プロジェクト: aktiWeb/formobject
 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;
 }
コード例 #3
0
 protected function fieldKey(Field $field)
 {
     return str_replace('__', '.', $field->getName());
 }
コード例 #4
0
ファイル: NamerChain.php プロジェクト: realholgi/formobject
 protected function getCacheId(Form $form, Field $field, $property)
 {
     return $form->getName() . '|' . $field->getName() . "|{$property}";
 }
コード例 #5
0
ファイル: Action.php プロジェクト: realholgi/formobject
 public function getAction()
 {
     if ($this->form) {
         return $this->form->getName() . '_' . parent::getName();
     }
 }