2017 © Pedro Peláez
 

library zucchi

Zucchi Component Library for Zend Framework 2

image

zucchi/zucchi

Zucchi Component Library for Zend Framework 2

  • Friday, July 22, 2016
  • by mattcockayne
  • Repository
  • 3 Watchers
  • 13 Stars
  • 1,177 Installations
  • PHP
  • 10 Dependents
  • 0 Suggesters
  • 12 Forks
  • 0 Open issues
  • 9 Versions
  • 3 % Grown

The README.md

Zucchi Framework Extensions

Custom extensions and additions to Zend Framework 2, (*1)

This Library uses PHP 5.4 features, (*2)

Components

  • Controller - Common controller features
  • DateTime - Custom Date/Time objects with pre defined __toString
  • Debug - Debug utilities
  • Event - Event Tools and traits
  • Form - Form factory with custom hydration
  • Image - Generic representation of an Image
  • ServiceManager - Service Manager Tools and Traits
  • Traits - A helper to get the traits of all ancestors
  • View - Custom Helpers and strategies

Request Parser Trait

This trait introduces consistent parsing of parameters in a query string that can then be consumed by appropriate Zucchi Query builder classes, (*3)

Simple query, (*4)

?where[forename][value]=john
&where[forname][operator]=fuzzy

Complex nexted where query without explicit field definitions, (*5)

?where[mode]=and
&where[expressions][0][mode]=or
&where[expressions][0][forename][value]=john
&where[expressions][0][forename][operator]=fuzzy
&where[expressions][0][surname][value]=john
&where[expressions][0][surname][operator]=fuzzy
&where[expressions][0][expressions][0][mode]=and
&where[expressions][0][expressions][0][email][value]=john
&where[expressions][0][expressions][0][email][operator]=fuzzy
&where[expressions][0][expressions][0][username][value]=john
&where[expressions][0][expressions][0][username][operator]=fuzzy
&where[expressions][1][id][value][0]=1
&where[expressions][1][id][operator]=nin

Complex nexted where query with explicit field definitions to allow use of "mode" & "expressions" as a field, (*6)

?where[mode]=and
&where[expressions][0][mode]=and
&where[expressions][0][fields][forename][value]=john
&where[expressions][0][fields][forename][operator]=fuzzy
&where[expressions][0][fields][mode][value]=active
&where[expressions][0][fields][surname][operator]=eq

Available operators and modes include, (*7)

    protected $requestOperators = array(
        'is'    => 'is',
        'eq'    => '=',
        'gt'    => '>',
        'gte'   => '>=',
        'lt'    => ' ' '!=',
        'in'   => 'in',
        'nin'   => 'not in',
        'between' => 'between',
        'fuzzy' => 'like',
        'regex' => 'regexp',
    );

    protected $requestModes = array(
        'or' => 'or',
        'and' => 'and',
    );

The Versions

08/07 2014

0.9

0.9.0.0 https://github.com/zucchi/Zucchi

Zucchi Component Library for Zend Framework 2

  Sources   Download

BSD-3-Clause

The Requires

 

library zf2