-
Notifications
You must be signed in to change notification settings - Fork 0
Ranking
The ranking service is a powerful set of features to help you move nodes around in your form. It preserves the order in which you want your inputs or html elements to appear in your forms.
add - after - ahead - before - down - inRanking - last - move - rank - remove - reverse - shuffle - sortByRank - toggle - toIndex - toRank - up
Add a node in the rankings.
Return the rank of the new node.
@return int
$form->ranking->add($node);
Move the node after another node in the ranking.
@return int
$form->ranking->move($node)->after($afterNode);
Move the node first in the ranking.
@return int
$form->ranking->move($node)->ahead();
Move the node before another node in the ranking.
@return int
$form->ranking->move($node)->before($beforeNode);
Move the node one rank down.
Return the new rank of the downgraded node.
@return int
$form->ranking->move($node)->down();
Check that the node is in the ranking.
@return bool
$form->ranking->inRanking($node);
Move the node last in the ranking.
Return the rank of the last node.
@return int
$form->ranking->move($node)->last();
Set the node id that is to reorder.
This method has to be called before using those that defines the action to be taken.
@return self
$form->ranking->move($node);
Return the rank of the node in the ranking.
@return int
$form->ranking->rank($node);
Remove a node in the ranking.
@return bool
$form->ranking->remove($node);
Reverse the ranks in the ranking.
@return void
$form->ranking->reverse();
Shuffle the ranks in the ranking.
@return void
$form->ranking->shuffle();
Order the list according to the nodes position in the ranking.
@return Collection
$form->ranking->sortByRank($nodes);
Toggle two nodes in the ranking.
Return the new rank of the first node.
@return int
$form->ranking->toggle($firstNode, $secondNode);
Move the node to a specific index.
Return the new index of the node.
@return int
$form->ranking->move($node)->toIndex(1);
Move the node to a specific rank.
Return the new rank of the node.
@return int
$form->ranking->move($node)->toRank(1);
Move the node one rank up.
Return the rank of the upgraded node.
@return int
$form->ranking->move($node)->up();