array ( 'getSuggestionList', 'setSession' ), 'users' => array ( '*' ) ), array ( 'deny', // deny all users 'users' => array ( '*' ) ) ); } public function actionGetSuggestionList() { // TODO get kind of list // TODO get real data // TODO scurity: use POST // get the value of the user input $prefixFilter = $_GET ['term']; // get list with all items of this field //TODO no hardcoding $listTitle = $_GET ['listTitle']; // $listTitle = ($_GET ['listTitle']=="familyName" ? $_SESSION['rankSearch'] : $_GET['listTitle']); $result = GGBNFormSuggestionsQueryManager::newFacetsList ( $listTitle, $prefixFilter ); // $list=array('foo'=>'bar', 'foo2'=>'batz'); $list = array (); // $list=array(array('label'=>'foo','value'=>'bar'), array('label'=>'foo2','value'=>'batz')); foreach ( $result as $attributeVal => $count ) { $list [] = array ( 'label' => $attributeVal . " (" . $count . ")", 'value' => $attributeVal ); } // $a=$this->selectionLists; // $b="full"; // if (empty($a)) { // $b="empty"; // } // $list = array ("foo",$listTitle); // $data = $this->filterToSuggestion ( $filter, $list ); echo CJSON::encode ( $list ); Yii::app ()->end (); } /** * Specifies the access control rules. * This method is used by the 'accessControl' filter. * * * @return array access control rules */ // public function accessRules() { // return array ( // array ( // 'allow', // allow all users to perform 'search' and 'test' action // 'actions' => array ( // 'setSession', 'getSuggestionList' // ), // 'users' => array ( // '*' // ) // ), // array ( // 'deny', // deny all users // 'users' => array ( // '*' // ) // ) // ); // } }