Download the PHP package cakedc/search-filter without Composer
On this page you can find all versions of the php package cakedc/search-filter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package search-filter
CakeDC SearchFilter Plugin for CakePHP
Versions and branches
CakePHP | CakeDC Users Plugin | Tag | Notes |
---|---|---|---|
^5.0 | 2.0 | 2.0.0 | stable |
^4.5 | 1.0 | 1.0.0 | stable |
Overview
The SearchFilter plugin is a powerful and flexible solution for implementing advanced search functionality in CakePHP applications. It provides a robust set of tools for creating dynamic, user-friendly search interfaces with minimal effort.
Features
- Dynamic filter generation based on database schema
- Support for various filter types: string, numeric, date, datetime, boolean, and lookup (autocomplete)
- Customizable filter conditions (equals, not equals, greater than, less than, between, etc.)
- Vue.js based frontend for an interactive user experience
- AJAX-powered autocomplete functionality for lookup filters
- Easy integration with CakePHP's ORM for efficient query building
- Extensible architecture allowing for custom filter types and conditions
Installation
You can install this plugin into your CakePHP application using composer:
Then, add the following line to your application's src/Application.php
file:
Configuration
- Criteria List
- Filters List
Basic Usage
Controller
In your controller, you can set up the search functionality like this:
This example demonstrates several key features of the SearchFilter plugin:
- Creating a new
Manager
instance and filter collection. - Adding a general search filter that can be used for quick searches.
- Creating a complex filter that searches across multiple fields using
OrCriterion
. - Adding a datetime filter for a specific field.
- Automatically generating filters based on the table schema.
- Applying filters when search parameters are present in the request.
- Using the
CriteriaFilter
for handling multiple filter criteria.
View
In your view, you can render the search component inside search form like this:
Advanced Usage
Custom Filter Types
Custom Range Filter implementation and integration
Frontend Customization
The plugin uses Vue.js for the frontend. You can customize the look and feel by overriding the templates in your application:
- Copy the
templates/element/Search/v_templates.php
file from the plugin to your application'stemplates/element/Search/
directory. - Modify the templates as needed.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This plugin is licensed under the MIT License.