PHP Classes

File: tests/infinityTree.php

Recommend this page to a friend!
  Classes of Ali YILMAZ   Mind Framework   tests/infinityTree.php   Download  
File: tests/infinityTree.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Mind Framework
Framework that implements several design patterns
Author: By
Last change:
Date: 1 year ago
Size: 921 bytes
 

Contents

Class file image Download
<?php
require_once ('../src/Mind.php');

$Mind = new Mind([
   
'db'=>[
       
'drive' => 'mysql', // mysql, sqlite
       
'host' => 'localhost',
       
'dbname' => 'mydb', // mydb, app/migration/mydb.sqlite
       
'username' => 'root',
       
'password' => '',
       
'charset' => 'utf8mb4'
   
]
]);

$data = [
    [
       
'id' => 33,
       
'name' => 'Series',
       
'parent' => null
   
],
    [
       
'id' => 34,
       
'name' => 'First dragon',
       
'parent' => 33
   
],
    [
       
'id' => 36,
       
'name' => 'Season 1',
       
'parent' => 34
   
],
    [
       
'id' => 38,
       
'name' => '1-10',
       
'parent' => 36
   
],
    [
       
'id' => 39,
       
'name' => 'Manga',
       
'parent' => null
   
]
];

$Mind->print_pre($Mind->infinityTree($data));

echo
'<hr>';

echo
'<select>';
echo
$Mind->selectTree($Mind->infinityTree($data));
echo
'</select>';