/** * Insert one Inputfield after one that's already there * * @param Inputfield $item Item you want to insert * @param Inputfield $existingItem Existing item you want to insert after * @return this * */ public function insertAfter(Inputfield $item, Inputfield $existingItem) { if ($this->children->has($existingItem)) { $item->setParent($this); $this->children->insertAfter($item, $existingItem); } else { if ($this->getChildByName($existingItem->attr('name')) && $existingItem->parent) { $existingItem->parent->insertAfter($item, $existingItem); } } return $this; }
/** * Insert one Inputfield after one that's already there * */ public function insertAfter(Inputfield $item, Inputfield $existingItem) { $item->setParent($this); $this->children->insertAfter($item, $existingItem); return $this; }
/** * Append another Inputfield to this Inputfield's children * */ public function append(Inputfield $item) { $item->setParent($this); $this->children->append($item); return $this; }