PHP code example of treetop1500 / easyadmin-dragndrop-sort
1. Go to this page and download the library: Download treetop1500/easyadmin-dragndrop-sort library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
treetop1500 / easyadmin-dragndrop-sort example snippets
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
class Page
{
...
/**
* @var integer $position
*
* @Gedmo\SortablePosition()
* @ORM\Column(name="position", type="integer")
*/
private $position;
/**
* @return int
*/
public function getPosition(): ?int
{
return $this->position;
}
/**
* @param int $position
*/
public function setPosition(?int $position)
{
$this->position = $position;
}
}