نمایش views exposed form در بلوک به روش برنامه نویسی

//create a view object first, e. g. $view = views_get_view('myViewName');
  //then set the demanded display_id, e. g. $display_id = 'page_1';
  $view = views_get_view('meetings');
  $display_id = 'page';
  $view->set_display($display_id);
  $view->init_handlers(); //initialize display handlers
  $form_state = array(
      'view' => $view,
      'display' => $view->display_handler->display,
      'exposed_form_plugin' => $view->display_handler->get_plugin('exposed_form'), //exposed form plugins are used in Views 3
      'method' => 'get',
      'rerender' => TRUE,
      'no_redirect' => TRUE,
  );
  $form = drupal_build_form('views_exposed_form', $form_state); //create the filter form
برچسب ها: 

افزودن نظر جدید