Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function actionSearch( $q = NULL ) {
- $query= $q;
- $account = new Account( 'search' );
- if ( Yii::app()->request->isAjaxRequest ) {
- if ( isset( $_POST['Account'] ) ) {
- $account->attributes = $_POST['Account'];
- }
- $accountDataProvider = $account->search();
- } else {
- $accountDataProvider = $account->querySearch( $query);
- if ( empty( $q ) ) {
- $accountDataProvider->setData( array() );
- }
- }
- $this->render( 'search' , array(
- 'accountDataProvider' => $accountDataProvider ,
- 'account' => $account ,
- ) );
- }
Advertisement
Add Comment
Please, Sign In to add comment