Zend Framework 2 modules

About a week ago SpiffyJr created a post on his blog outlining his modules and their state. I quite liked the initiative, and felt like following up on this (what I hope to become) trend.

The reason I feel this is a good idea, is because there seems to be a lot of duplicate module creation. Zend Framework 2 developers don’t always realise something already exists, so decide to build something themselves. This is a waste of time, efforts and talent, which are all things I hate wasting. For this reason, I’ve compiled my own list of modules. So following is a description of my modules.

Modules

Most of my modules reside under the SpoonX organisation. The modules that make it to the organisation are stable, or at least complete enough. Currently, the only module that’s stable but not under the spoonx namespace, is the AssetManager module.


AssetManager

Summary

Description

As perfectly described in the readme:

This module provides functionality to load assets and static files from your module directories through simple configuration. This allows you to avoid having to copy your files over to the public/ directory, and makes usage of assets very similar to what already is possible with view scripts, which can be overridden by other modules. In a nutshell, this module allows you to package assets with your module working out of the box.

On top of this, the module also allows you to apply filters, apply caching, create collections, create custom resolvers, create custom filters and create custom cachers.


SxBootstrap

Summary

Description

This module is a wrapper for twitter bootstrap. It comes with some neat features allowing you to do some cool things.

Features (as taken from the README.md):

  • Simple awesome forms (group action controls, create horizontal forms etc)
  • Fast
  • Customisable (variables, components, plugins. No more downloading zip files!)
  • Works with the AssetManager
  • Plenty of ViewHelpers
  • Extendable (run your own less files from bootstrap context to share mixins and variables)

SxBootstrapWizard

Summary

Description

There’s not much to this module. It’s a plugin for SxBootstrap that allows you to easily create stunning wizards.


SxCore

Summary

Description

This is (currently) a very small library. It has two components.

SxCore\Html\HtmlElement

The HtmlElement is pretty neat, it allows you to easily create markup using php. This is especially useful when creating viewhelpers; which is the reason it’s being used by SxBootstrap so intensively.

I started writing this component because of the annoying way Zend\Form\Element were written, and the restrictions they had. I was constantly messing around with strings (eww) and found myself unable to add ng- attributes due to restrictions (which, if you’ve ever used angular, is extremely annoying).

You can find some examples here.

SxCore\Html\ExcerptExtractor

This neat little component allows you to extract excerpts from bundles of markup without breaking the tags. This is really useful when it comes to, I don’t know, writing a blog (Yes, I’m hinting at SxBlog).


SxMail

Summary

Description

This module makes it incredibly easy to set up mailings. It does all of the boring work for you, and supplies useful functionality such as using ViewModels as templates and wrapping those templates in a layout. It also allows you to set up multiple configurations for multiple mailings, which will be merged with the default configuration (marked by the “default” key).

Features (as taken from the README.md):

  • Easily configurable. Both messages and transport.
  • Use ViewModels
  • Layout support
  • Mimepart detection
  • Easy header configuration
  • Access to Zend* classes
  • Generates alternative (text) body
  • 100% code coverage
  • Scratches your back after a long day of work
  • Makes a good drinking buddy.

SxBlog

Summary

Description

This module is an attempt at creating a skeleton blog for minimalist bloggers (such as myself). It already includes a handful of features, but isn’t complete yet.

Here’s a screenshot of it in use:


SxSkeletonModule

Summary

Description

This is not really a module. It’s basically a skeleton module (yes, I know, the repository name sort of gave that away) that allows you to easily start a new Zend Framework 2 module. It includes a license, composer.json, a module structure and basic tests. It’s easily used by running the setup script that’s bundled with it.

The following is the easiest way to get this up and running: git clone git@github.com:SpoonX/SxSkeletonModule.git; cd SxSkeletonModule; ./setup.sh Username ModuleName; cd ..;

Note: Make sure you change the Username and ModuleName to yours. It’s used for the composer.json (and more files).

Conclusion

Writing this post took me quite a while but it was worth it. I hope it’ll help a developer or two. Building modules is awesome; but nothing’s as satisfying as watching people use, and enjoy using them.

There are obviously a lot more modules out there. A while ago Hounddog created a Zend Framework 2 modules application for which I helped out with the styling. It’s a really neat resource if you’re looking for modules, and I strongly suggest you submit your modules, too!

Happy coding!

1 Comment

Add yours →

  1. Thanks for giving useful info

Leave a Reply


4 − one =

©SpoonX 2017