jqAjaxSearch - how does it work?


I recently started using the Yii framework and so far everything went well but now I tried to use the jqAjaxSearch extension and it won’t work for me.

What i want it to do:

  • Search my Database for Articles with titles, containing keywords, which were entered in the search bar

What i did so far:

  • The widget is implemented so that I see the search bar

  • it already calls my search function in my Controller

  • it updates my search_results div tag in the view, displaying things specified in the controller

My Problem:

  • I absolutely have no Idea where the entered input text (the search keywords) are stored

eg: User wants to search Articles containing the String "Health"

Now where i get the entered string?

my Code looks like this:

The Controller:

// here i want to implement the search functionality

public function actionSearch() {

            // here is the problem:

            // I want to know what has been entered in the search bar here

            echo "This is correctly displayed in the search_results div-tag";


            // will be used later for displaying the search results page and is working too



The View (where my search bar is located):



        array('action'=>array('search'), 'target'=>'search_results', 'minChar'=>2));


<div id="search_results">



I really hope someone can help me. As I said before I just started over with Yii and I am not really familiar with the very basics like using widgets and accessing their content like the above described string.

I’m glad for any Tips & sorry for the noob question but maybe it will help other beginners too ^^



Hi again :)

Problem solved ^^ I just got too far away from normal php while using the Yii framework :D


I was all the time able to access the input values with the $_POST array -.-

sorry for the noob post! :)

    public function actionSearch() {


        echo $_POST["search_term"];