1. Go to this page and download the library: Download gmars/tp5-nestedsets 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/ */
gmars / tp5-nestedsets example snippets
class User extends Model
{
public $nestedConfig = [
'leftKey' => 'lft',
'rightKey' => 'rgt'
];
}
$userModel = new User();
$nestedObj = new NestedSets($userModel);
$userModel = new User();
$nested = new NestedSets($userModel, "lftkey", "rgtkey");
$userModel = new User();
$nested = new NestedSets("user");