Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Mark Scherer:
Developing CakePHP 3+ Plugins, it’s fun!
Feb 01, 2016 @ 18:08:04

Mark Scherer has a post to his site looking at developing CakePHP 3+ plugins, showing how it's much easier than it used to be with previous versions of the framework.

he days of CakePHP 2 plugins and how difficult it was to actually develop plugins are over. Back in the days (OK, I still have to do it once in a while), there was even an app required to test a plugin. Since you didn’t want to have a boilerplate app for each plugin, you usually worked in your actual app. So you had cross contamination from that messing up your tests and stuff. Really annoying.

[...] While most of the concrete examples are about plugin development for CakePHP 3, the main ideas apply to all library code you write. And if you are a developer for other frameworks, the same principles apply, only the concrete implementation might differ.

He starts with the "real story" behind his development of a plugin - a need to integrate hashid support into a CakePHP v3-based application. He uses his own library as an example (here on GitHub) and shares his thought and development process in its creation. He then shares a few helpful tips for the would-be plugin authors out there:

  • Thinking about what should be in core vs a plugin.
  • Try to follow coding and package principles.
  • Following the six package principles including common reuse, common closure and package coupling practices.
tagged: cakephp3 framework plugin example principles tips hashid

Link: http://www.dereuromark.de/2016/01/29/developing-cakephp-3-plugins-its-fun/


Trending Topics: