#ZnZend
Zend Framework 2 module containing helpers and base classes for my projects at intzone.com.
This is a Zend Framework 2 module containing revamps of the helpers and classes I used for my Zend Framework 1 projects. This is more of a general-purpose module unlike ZfcUser and is meant to quickstart my ZF2 projects.
-
PHP 5.3.3 and above
-
Zend Framework 2
-
Doctrine Common 2.1 and above (for use in
Zend\Form\Annotation
)If you downloaded Doctrine from GitHub instead of using Composer, you will need to add Doctrine to the autoloading namespaces in
init_autoloader.php
orModule.php
. The same goes for any non-ZF2 modules.// init_autoloader.php Zend\Loader\AutoloaderFactory::factory(array( 'Zend\Loader\StandardAutoloader' => array( 'autoregister_zf' => true, 'namespaces' => array( // register libraries which use namespace __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, 'Doctrine' => __DIR__ . '/vendor/doctrine', ), 'prefixes' => array( // register libraries which use vendor prefix (underscore) // same format as 'namespaces' ), ) )); // Module.php public function getAutoloaderConfig() { return array( 'Zend\Loader\ClassMapAutoloader' => array( __DIR__ . '/autoload_classmap.php', ), 'Zend\Loader\StandardAutoloader' => array( 'namespaces' => array( __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, 'Doctrine' => __DIR__ . '/vendor/doctrine', ), 'prefixes' => array( // register libraries which use vendor prefix (underscore) // same format as 'namespaces' ), ), ); }
- Clone this project into your
./vendor/
directory and enable it in yourapplication.config.php
file under themodules
key - Examples can be found in the
examples
directory - Tests can be run in browser using
test/phpunit_browser.php
(see inline docblock)
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\AuthenticationService
in theServiceManager
, similar to the Zend Identity controller plugin. The service does not exist but defaults toZend\Authentication\AuthenticationService
znZendMvcParams
- 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 using ZnZend\Captcha\Question adapterznZendFormElement
- OverridesformElement
helper 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 Twitter Bootstrap 2 "row-fluid" and "span*" classes