Zend Framework 2/3 module containing helpers and base classes for my projects at intzone.com.
ZnZend v0.3.0
30 December 2017
Please see CHANGELOG.md.
This started off as a Zend Framework 2 module containing revamps of the helpers and classes I used for my Zend Framework 1 projects. This is a general-purpose module unlike ZfcUser and is meant to quickstart my ZF2 projects.
This module has been updated to work with PHP 7 and Zend Framework 3 from release v0.3.0 onwards.
For the Zend Framework 2 version, use the v0.2.0 release.
- PHP >= 7.0
- Composer
- Zend Framework 3
-
As this module is not available on Packagist, the GitHub repository needs to be added to
composer.jsonin the ZF3 project.{ "repositories": [ { "type": "git", "url": "https://github.com/zionsg/ZnZend" } ] } -
Run
composer require zionsg/ZnZendto get the latest release in themasterbranch. To get thedevelopbranch, runcomposer require zionsg/ZnZend:dev-develop. -
Ensure that the
ZnZendmodule is enabled inconfig/modules.config.phpin the ZF3 project. -
To check coding style (CS) errors, run
composer cs. -
To run tests, run
composer test. -
See
scriptskey incomposer.jsonfor other scripts. -
Examples can be found in
docs/examples.
ZnZend\Authentication\IdentityInterface- Interface for identity stored in authentication serviceZnZend\Db\EntityInterface- An entity interface for database rowsZnZend\Db\MapperInterface- An entity mapper interface for database tablesZnZend\Captcha\Service\QuestionServiceInterface- An interface for services providing questions for captchaZnZend\Json\JsonProviderInterface- An interface to provide JSON representation for an objectZnZend\Permissions\Acl\Role\RoleInterface- Adds additional methods for comparing 2 roles
ZnZend\Authentication\Identity- Class for identity stored in authentication serviceZnZend\Crypt\Symmetric\OpenSsl- Symmetric encryption using the OpenSSL extensionZnZend\Form\AbstractForm- Base form class with additional featuresZnZend\Db\AbstractEntity- An abstract entity class for database rowsZnZend\Db\AbstractMapper- An abstract entity mapper class for database tablesZnZend\Db\Generator\EntityGenerator- For generating entity classes from tables in a databaseZnZend\Db\Generator\MapperGenerator- For generating entity mapper classes from tables in a databaseZnZend\Paginator\Adapter\DbSelect- Additional methods to retrieve and update Select objectZnZend\Permissions\Acl\Acl- Modified addResource() to add a resource and its parents recursivelyZnZend\Permissions\Acl\Privilege- A standardized set of constants for Acl privilegesZnZend\Permissions\Acl\Role\GenericRole- Generic role that defaults to 'guest' and where smaller numbers indicate higher role rank
ZnZend\Captcha\Question- Captcha adapter for custom questions and answersZnZend\Captcha\Service\MathQuestionService- A service which provides simple arithmetic questions for captcha
znZendDatabaseRowSize- Calculate row size for each table in specified databaseznZendDataTables- Update Paginator (DbSelect) with params sent from jQuery DataTables pluginznZendIdentity- Fetch the authenticated identity as an instance of IdentityInterface and its role as an instance of RoleInterface. When invoked, its factory will look for a service by the nameZnZend\Authentication\AuthenticationServicein theServiceManager, similar to the Zend Identity controller plugin. The service does not exist but defaults toZend\Authentication\AuthenticationServiceznZendMvcParams- Get name of module, controller and action as like in ZF1znZendPageStore- Persist data for current page across reloads of the same pageznZendRestJson- Consume REST web service which returns JSON resultznZendTimestamp- Return timestamp formatted to standard length and converted to base 36
ZnZend\Filter\File\RenameUploadWithCallback- Allows use of custom callback to rename file uploads
ZnZend\Form\Element\Value- Element for displaying value only without<input>
znZendFormCaptchaQuestion- Render captcha element usingZnZend\Captcha\QuestionadapterznZendFormElement- OverridesformElementhelper to handle rendering of ZnZend form elementsznZendFormValue- Render value of element only without<input>
ZnZend\Listener\LogListener- Simple log listener to listen to events named after RFC5424 severity levels and exceptions
znZendColumnizeEntities- Output entities in columns using<table>znZendContrastColor- Choose color that provides sufficient constrast when combined with specified colorznZendExcerpt- Extract excerpt from textznZendFormatBytes- Format bytes to human-readable formznZendFormatDateRange- Format a date rangeznZendFormatTimeRange- Format a time rangeznZendResizeImage- Make resized copy of image and return path for use in HTML<img>znZendSpanEntities- Output collection of entities in columns based on Bootstrap 2 "row-fluid" and "span" classes

