Help me! Transfer variable from view to controller

I have a controller as following:




          public function actionAjaxFillTree($parentId){

	    if (!Yii::app()->request->isAjaxRequest) {

		    exit();

	    }

	    $sql = "SELECT m1.id, m1.title AS text, m2.id IS NOT NULL AS hasChildren,m1.url,m1.icon,m1.tooltip,m1.options "

	    . "FROM menu_adjacency AS m1 LEFT JOIN menu_adjacency AS m2 ON m1.id=m2.parent_id "

	    . "WHERE m1.parent_id <=> $parentId "

	    . "GROUP BY m1.id ORDER BY m1.position ASC";

	    $req = Yii::app()->db->createCommand($sql);

	    $children = $req->queryAll();

	    echo str_replace(

		    '"hasChildren":"0"',

		    '"hasChildren":false',

		    CTreeView::saveDataAsJson($children)

	    );

	    exit();

	}



and a view.

I want to fransfer a variable from view to controller.





<?php

echo "jdfkhgkfd";

        $this->widget(

                'CTreeView',

                array(

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

                        'collapsed' => true,

                        'url' => array('/site/ajaxFillTree','$parentId'=>3),

                )

        );

?>



it does’nt work.

How could i do?

Someone help me!

Thanks you

Hi,

‘$parentId’=>3

replace with

‘parentId’=>3

on controller you have to get this variable on $_GET[‘parentId’]

Thanks

:(

I don’t display ‘parentId’=>3 on url, don’t use $_GET[‘parentId’]

You have another solution?

:(

Help me!

Hi,

now you will take one form and than make hidden for this . than you will get this on $_POST.

Thanks