Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- class Contoh extends MY_Controller{
- public function __construct()
- {
- parent::__construct();
- $this->load->library(array("btree"));
- }
- function get($id)
- {
- $is_parent = $this->btree->cek_is_parent($id);
- foreach ($is_parent as $value) {
- $data[$value]= $this->add_pairing($value);
- }
- echo json_encode($data);
- }
- function add_pairing($id)
- {
- $left = $this->btree->get_left_id_children($id);
- $right = $this->btree->get_right_id_children($id);
- $data = array($left ,$right );
- return $data;
- }
- } //end class contoh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement