Download the PHP package redbean-fvm/redbean-fvm without Composer
On this page you can find all versions of the php package redbean-fvm/redbean-fvm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download redbean-fvm/redbean-fvm
More information about redbean-fvm/redbean-fvm
Files in redbean-fvm/redbean-fvm
Package redbean-fvm
Short Description Redbean FVM makes Filtering,Validating , and Generating RedBean Models easy.
License MIT
Informations about the package redbean-fvm
RedBeanFVM
RedbeanFVM makes Filtering, Validating , and Generating RedBean Models easy.
Features:
- 16 built in filter and validation functions.
- simple api allows users to define custom named filters.
- chainable filters
- fully automates the process of creating a redbean Model - simply pass in a the bean and a list of required rules Multi-deminsional Array:
Array(datakey => rules)
, a list of optional rules, and the data source, which defaults to the$_POST
superglobal. RedBeanFVM searches your data source for the key, performs the filtering rule(s) and stores this into the model. pretty flippin sweet huh? - automatically converts datakeys to snake case as required by RedBean.
- Singleton Interface with dynamic methods. No need to juggle references across business logic or pass it down through functions. create custom filters anywhere, and they will persist via static references.
simply retrieve a reference to the library at anytime like so
$fvm = \RedBeanFVM\RedBeanFVM::getInstance();
Installation
Install via Composer:
-
install with composer:
- add code to project:
Download and Manually Install:
-
download/clone the package:
- add this snipped of code:
Examples
-
basic usage:
-
optional parameters:
-
custom data source
-
manual usage of the methods.
-
chainable methods with chain()
-
custom filters(named closures)
-
advanced custom filters.
- Some functions like
name
accept optional second parameters. - by design, FVM only accepts 1 argument, the $input to be filtered.
- we can work around this like so:
- Some functions like
-
calling custom filter directly on $fvm is possible.
-
checkboxes
-
loading a custom filter class.
-
required and optional can be called directly.
-
file uploads (coming soonish)
-
all config options and their default values.
- optional defaults explained.
Requirements:
RedBean, obviously http://www.redbeanphp.com/
Development
Want to contribute? Great! Pull Requests welcomed!
Todo's
- Write Tests
- Language Packs (Locale's)
- Expand Features.