示例#1
0
 public function moveChildToPosition(ItemInterface $child, $position)
 {
     $name = $child->getName();
     $order = array_keys($this->children);
     $_position = array_search($name, $order);
     unset($order[$_position]);
     $order = array_values($order);
     array_splice($order, $position, 0, $name);
     $this->reorderChildren($order);
     return $this;
 }