Search into CGridView originating from another page

I have a small search box that posts to a page with a CGridView … like a quick search

in the CGridView controller i do this…

if(isset($_GET[‘Account’]))

$model->attributes=$_GET['Account'];

if(isset($_POST[‘Account’]))

$model->attributes=$_POST['Account'];

everything displays correctly except the next buttons don’t have the GET information for paging…

i was wondering if anyone has any ideas…

  • Thanks, B

Hello

If you consider the Gii-generated code for the admin action, it’s like below. Have you tried the standard way?


public function actionAdmin() {

    $model = new YourModel('search');

    $model->unsetAttributes();


    if (isset($_GET['YourModel']))

        $model->setAttributes($_GET['YourModel']);


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

        'model' => $model,

    ));

}