How To Create A Very Simple 3 Level Ctreeview

Hi all,

Could someone help me to create a treeview with CTreeview

title

-subtitle

–element

—link to version 0

—link to version 1

—link to version 2

my table

specification

id

text

parentId

element

id

specificationId

version





<?php

//TreeControler.php

public function actionIndex() {

        // HOW TO CREATE MY DATATREE ARRAY ?

        $this->render('index', array(

            'dataTree' => $dataTree,

        ));

    }


//index.php

$this->widget('CTreeView', array(

    'data' => $dataTree,

    'animated' => 'fast', //quick animation

    'collapsed' => 'false', //remember must giving quote for boolean value in here

    'htmlOptions' => array(

        'class' => 'treeview-red', //there are some classes that ready to use

    ),

));

?>


Thanks for Helps