本文整理汇总了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)))));
}