本文整理匯總了PHP中Tree::setItemOrder方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tree::setItemOrder方法的具體用法?PHP Tree::setItemOrder怎麽用?PHP Tree::setItemOrder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Tree
的用法示例。
在下文中一共展示了Tree::setItemOrder方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setActionOrder
/**
* Set action sorting order
* @param string $id
* @param integer $order
*/
public function setActionOrder($id, $order)
{
$this->_actions->setItemOrder($id, $order);
}
示例2: setItemOrder
/**
* Set item order
* @param mixed $id
* @param integer $order
* @return boolean - success flag
*/
public function setItemOrder($id, $order)
{
return $this->_tree->setItemOrder($id, $order);
}
示例3: setItemOrder
/**
* Set item order
* @param mixed $id
* @param integer $order
* @return boolean - success flag
*/
public function setItemOrder($id, $order)
{
return $this->_columns->setItemOrder($id, $order);
}
示例4: test_sortChilds
public function test_sortChilds()
{
$tree = new Tree();
$tree->addItem('a', 0, 50, 1);
$tree->addItem(1, 'a', 100, 1);
$tree->addItem(2, 'a', 200, 2);
$tree->addItem(3, 'a', 300, 3);
$tree->setItemOrder(2, 4);
$tree->sortItems('a');
$items = $tree->getChilds('a');
$newOrder = array();
foreach ($items as $v) {
$newOrder[] = $v['data'];
}
$this->assertEquals($newOrder, array(100, 300, 200));
$tree = new Tree();
$tree->addItem(1, 0, 100, 1);
$tree->addItem(2, 0, 200, 2);
$tree->addItem(3, 0, 300, 3);
$tree->setItemOrder(2, 4);
$tree->sortItems();
$items = $tree->getChilds(0);
$newOrder = array();
foreach ($items as $v) {
$newOrder[] = $v['data'];
}
$this->assertEquals($newOrder, array(100, 300, 200));
}