本文整理汇总了PHP中AppController::search方法的典型用法代码示例。如果您正苦于以下问题:PHP AppController::search方法的具体用法?PHP AppController::search怎么用?PHP AppController::search使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppController
的用法示例。
在下文中一共展示了AppController::search方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view
public function view($id = null)
{
$tmpPost = $this->Post->find('first', array('conditions' => array('Post.id' => $this->request->params['id'])));
$this->set('tmpPost', $tmpPost);
$data = array('applicationId' => '1020646643727437143', 'format' => 'xml', 'isbn' => $tmpPost['Post']['isbn']);
$items = parent::search($data);
$this->set('items', $items);
$tmp = $this->Review->find('all', array('conditions' => array('Review.post_id' => $tmpPost['Post']['id'], 'Review.user_id' => $this->Auth->user('id'))));
if (!empty($tmp)) {
$this->set('tmp', $tmp);
}
$tmpReviews = $this->Review->find('all', array('conditions' => array('Review.post_id' => $tmpPost['Post']['id'])));
if (!empty($tmpReviews)) {
$this->set('tmpReviews', $tmpReviews);
}
}
示例2: search
public function search($q = null, $fields = array())
{
if (isset($this->request->data['q'])) {
$this->redirect(Router::uri('blogSearch', array('q' => $this->request->data['q'])));
}
parent::search($q, array('text', 'headline', 'tags'));
$this->action = 'index';
$this->data->set('q', $q);
return true;
}
示例3: function
});
$routes->get('/tasks/incomplete/:id', 'check_logged_in', function ($id) {
AppController::markInComplete($id);
});
$routes->get('/tasks/edit/:id', 'check_logged_in', function ($id) {
AppController::editTask($id);
});
$routes->post('/tasks/edit/:id', 'check_logged_in', function ($id) {
AppController::updateTask($id);
});
$routes->get('/tasks/delete/:id', 'check_logged_in', function ($id) {
AppController::deleteTask($id);
});
$routes->get('/hiekkalaatikko', function () {
AuthController::sandbox();
});
$routes->get('/categories/create', 'check_logged_in', function () {
CategoriesController::createCategory();
});
$routes->post('/categories/create', 'check_logged_in', function () {
CategoriesController::storeCategory();
});
$routes->get('/categories/delete/:id', 'check_logged_in', function ($id) {
CategoriesController::deleteCategory($id);
});
$routes->get('/tasks/category/:id', 'check_logged_in', function ($id) {
AppController::categoryTasks($id);
});
$routes->post('/tasks/search', 'check_logged_in', function () {
AppController::search();
});
示例4: register
public function register()
{
$data = array('applicationId' => '1020646643727437143', 'format' => 'xml', 'isbn' => $this->request->params['pass']['0']);
$items = parent::search($data);
if ($this->request->is('post')) {
$tmp = NULL;
$tmp = $this->Post->find('first', array('conditions' => array('Post.isbn' => $items['0']['ISBN'])));
if (!empty($tmp)) {
$tmpReview['Review']['reading'] = $this->request->data['Review']['reading'];
$tmpReview['Review']['value'] = $this->request->data['Review']['value'];
$tmpReview['Review']['username'] = $this->Auth->user('username');
$tmpReview['Review']['post_id'] = $tmp['Post']['id'];
$tmpReview['Review']['user_id'] = $this->Auth->user('id');
if ($this->Review->save($tmpReview)) {
$this->redirect('/posts/view/' . $tmp['Post']['id']);
}
}
$tmpsave['Post']['title'] = $items['0']['TITLE'];
if (!empty($items['0']['AUTHOR'])) {
$tmpsave['Post']['author'] = $items['0']['AUTHOR'];
}
if (!empty($items['0']['SALESDATE'])) {
$tmpsave['Post']['salesdate'] = $items['0']['SALESDATE'];
}
$tmpsave['Post']['thumbnail'] = $items['0']['LARGEIMAGEURL'];
$tmpsave['Post']['isbn'] = $items['0']['ISBN'];
$this->Post->save($tmpsave);
$tmpReview['Review']['reading'] = $this->request->data['Review']['reading'];
$tmpReview['Review']['value'] = $this->request->data['Review']['value'];
$tmpReview['Review']['username'] = $this->Auth->user('username');
$tmpReview['Review']['post_id'] = $this->Post->getLastInsertId();
$tmpReview['Review']['user_id'] = $this->Auth->user('id');
if ($this->Review->save($tmpReview)) {
$this->redirect('/posts/view/' . $this->Post->getLastInsertId());
$this->Session->setFlash('Success');
}
}
}