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