CakePHP
  • Documentation
    • Bootstrap UI
    • CakePDF
    • Crud
    • Crud Users
    • Crud View
    • CsvView
    • Search
  • Community
    • Help & Support
    • Stack Overflow
    • IRC
    • Slack
CakePHP

B Crud Documentation

Improve This Doc

Page Contents

  • Search
    • Introduction
    • Setup
      • Installation
      • Controller

Search¶

This listener provides search capabilities for the Crud plugin.

Introduction¶

The Search listener depends on the friendsofcake/search package.

Setup¶

Installation¶

composer require friendsofcake/search

Controller¶

Attach it on the fly in your controllers beforeFilter, this is recommended if you want to attach it only to specific controllers and actions.

<?php
class SamplesController extends AppController {

  public function beforeFilter(\Cake\Event\Event $event) {
      $this->Crud->addListener('Crud.Search');

      parent::beforeFilter($event);
  }
}

Attach it using components array, this is recommended if you want to attach it to all controllers, application wide.

<?php
class DemoController extends AppController {

    public function initialize()
    {
        $this->loadComponent('Crud.Crud', [
            'actions' => [
                'index'
            ],
            'listeners' => [
                'Crud.Search'
            ]
        ]);
    }
}

Preface

  • Introduction
  • Installation

Usage

  • Quick Start
  • Configuration
  • Actions
  • Events
  • Event subject
  • Listeners
    • API
    • API Pagination
    • API Query Log
    • JSON API
    • Redirect listener
    • Related Models
    • Search
    • Create your own
  • Creating an Api
  • Unit Testing

Navigation

  • index
  • next |
  • previous |
  • Crud v4 »
  • Listeners »
  • Documentation
  • Bootstrap UI
  • CakePDF
  • Crud
  • Crud Users
  • Crud View
  • CsvView
  • Search
  • Help & Support
  • Stack Overflow
  • IRC
  • Slack

© Copyright 2017, Friends of Cake. Last updated on Jun 04, 2017. Created using Sphinx 1.5.1.