当前位置: 首页>>代码示例>>PHP>>正文


PHP DataFilter::pick方法代码示例

本文整理汇总了PHP中DataFilter::pick方法的典型用法代码示例。如果您正苦于以下问题:PHP DataFilter::pick方法的具体用法?PHP DataFilter::pick怎么用?PHP DataFilter::pick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataFilter的用法示例。


在下文中一共展示了DataFilter::pick方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: admin_index

 function admin_index()
 {
     $this->paginate = array('limit' => 20);
     $mailCustomerCategories = $this->MailCustomer->MailCustomerCategory->find('list');
     $this->set(compact('mailCustomerCategories'));
     $this->MailCustomer->recursive = 0;
     $current_category = 0;
     $type = "E";
     $q = "";
     $conditions = array();
     $search_data = array();
     if (DataFilter::pick($this->params, 'named')) {
         $search_data = DataFilter::pick($this->params, 'named');
     } else {
         if (DataFilter::pick($this->params, 'data')) {
             $search_data = DataFilter::pick($this->params, 'data');
         }
     }
     if ($form_data = DataFilter::pick($this->params, 'form')) {
         $search_data['q'] = $form_data['q'];
     }
     if ($category = DataFilter::pick($search_data, 'category')) {
         $conditions['MailCustomer.mail_customer_category_id'] = $current_category = $category;
     }
     if ($q = trim(DataFilter::pick($search_data, 'q'))) {
         $keyword = "%{$q}%";
         $type = DataFilter::pick($search_data, 'type');
         if ($type == "N") {
             $conditions['MailCustomer.nickname LIKE'] = $keyword;
         } else {
             $conditions['MailCustomer.email LIKE'] = $keyword;
         }
     }
     if (!empty($search_data)) {
         $this->passedArgs = $search_data;
     }
     $this->set('mailCustomers', $this->paginate(null, $conditions));
     $this->set("current_category", $current_category);
     $this->set("q", $q);
     $this->set("type", $type);
     $this->breakcrumb = array('nav' => array(array('text' => __("Customers", true), 'url' => '/admin/webmailler/mail_customers'), array('text' => __("Listing", true))), 'actions' => array(array('text' => __("New", true), 'url' => '/admin/webmailler/mail_customers/add', 'class' => 'act-new', 'attr' => array('class' => 'ex4Trigger', 'title' => __("New Customer", true))), array('text' => __("Delete", true), 'url' => '###', 'class' => 'act-del'), array('text' => __("Export", true), 'url' => '/admin/webmailler/mail_customers/export', 'class' => 'act-new', 'attr' => array('title' => __("Export Customers", true))), array('text' => __("Import", true), 'url' => '/admin/webmailler/mail_customers/import', 'class' => 'act-new', 'attr' => array('class' => 'ex4Trigger', 'title' => __("Import Customers", true)))));
 }
开发者ID:laiello,项目名称:myopensources,代码行数:42,代码来源:mail_customers_controller.php


注:本文中的DataFilter::pick方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。