News Feed
Sections




News Archive
feed this:

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

Piotr Pasich:
CakePHP with Symfony's2 router
August 13, 2014 @ 09:46:27

Piotr Pasich has a new post to his site today showing you how you can use the Symfony2 router with CakePHP, another popular PHP framework. He talks about some of his own experiences using CakePHP and how one module "left a bitter aftertaste" when using it - the route handling.

The second version of CakePhp still has a lot old-fashioned patterns, singletons or lack of tests, but I can live with that. I saw a lot of better or worse frameworks in my life.

He goes through an example of the CakePHP routing including some sample code and a walk-through of the code that actually handles the request. He points out some of the "clean code" violations it makes and gets started integrating the Symfony2 router instead. He extends the CakePHP router and uses this plugin to bridge between the two. He then can call the Symfony router with only slight modifications to things like the "getPath" calls.

0 comments voice your opinion now!
cakephp symfony2 router integrate plugin tutorial

Link: http://piotrpasich.com/cakephp-with-symfonys2-router/

Master Zend Framework:
Accessing ServiceManager Services in Controller Plugins
July 31, 2014 @ 09:43:49

Matthew Setter has posted another new tutorial to his Master Zend Framework site today showing you how to access ServiceManager services in controller plugins. Controller plugins are a Zend Framework feature that allows certain events to trigger the plugin code during the lifetime of the controller.

I've seen some questions on Google+ and StackOverflow of late, regarding how to get access to the Zend Framework 2 database adapter, along with other ServiceManager-defined services, in a custom controller plugin. This type of setup can come in handy for a number of situations. You may want to access services such as caching, logging or databases and want to provide a simple interface for doing so. People seem really interested in how to do it, but how to get access to services from the ServiceManager doesn't seem to be as clear as it could be. Gladly, there's not much involved in actually doing it.

He shows you how to create a plugin for an existing module, creating the two needed classes and adding a new function to configure it. He starts with the plugin factory that can be used to generate an instance of the plugin. Next is the plugin class itself that extends the abstract plugin and controller plugin classes. The required database adapter is injected into it via a constructor injection. Finally, in the Module.php configuration, he creates a "getControllerPluginConfig" method that registers the new plugin and points to its class. A screencast is also provided showing the active development of the code.

0 comments voice your opinion now!
servicemanager plugin controller tutorial access zendframework2

Link: http://www.masterzendframework.com/servicemanager/accessing-servicemanager-services-controller-plugins

NetTuts.com:
How To Display Post Meta Data on a WordPress Post
July 11, 2014 @ 10:44:41

NetTuts.com has a a recent tutorial showing you how to show the metadata from a posting in WordPress right along with the other post data.

During the course of the series, one of the things that we did in order to help demonstrate the object-oriented principles as well as some of the features of the WordPress API was build a plugin. Specifically, we built a plugin that allowed us to view all of the post meta data associated with a given post within the WordPress dashboard. [...] Since that particular post was written, I've received a number of different questions one of which has been how do we take the data displayed in the dashboard - that is, the post meta data - and display it on the front end of the web site. In this article, we're going to take a look at extending the plugin such that we can display the data on a single post page.

To display the data, they actually extend the plugin they've already made. They start with some of the issues of this method (and the data itself) that you might run into during the development. They create a "public" directory to store the cached metadata in and a manager class to handle the functionality. The class loads the data and uses output buffering to capture the data. A public hook is defined to call the "display" action on each page load and the results are passed out to the view.

0 comments voice your opinion now!
wordpress metadata plugin extend tutorial action

Link: http://code.tutsplus.com/tutorials/how-to-display-post-meta-data-on-a-wordpress-post--cms-21658

SitePoint PHP Blog:
10 Essential Sublime Text Plugins for Full-Stack Developers
July 09, 2014 @ 12:32:33

Users of the Sublime Text 2 editor already know how flexible and useful it can be in developing their own software. SitePoint has a new post that wants to help enhance that experience even more with a list of 10 essential plugins you can use as a full-stack developer.

When I started with web development a few years ago, Vim was my first choice of text editor. It was easy to work with and I could get the basics done without much hassle. [...] In spite of the "Vim vs Emacs" debate out there, about a year ago I decided to try out a native text editor and Twitter was abuzz with one of them (no prizes for the guessing which one.) The creators of Sublime Text say it's a text editor you'll fall in love with and, having worked with it for almost a year now, I must say I completely agree with them.

Among their "top 10" list are things like:

  • Package Control
  • GitGutter
  • AllAutocomplete
  • ColorPicker
  • DocBlockr

Each item on the list comes with a link to the library, a brief description of what it has to offer and a screenshot (in most cases) of it at work.

0 comments voice your opinion now!
essential sublimetext2 plugin list fullstack developer

Link: http://www.sitepoint.com/10-essential-sublime-text-plugins-full-stack-developer/

Lorna Mitchell:
First Phing Plugin
March 25, 2013 @ 10:49:23

In the latest post to her site, Lorna Mitchell walks you through the creation of a first Phing plugin, an extension to the popular PHP-based build tool.

I'm a huge fan of Phing and use it regularly for build and deployment tasks. Often, I'll ask about a plugin that I wish existed, and get a very courteous "patches welcome" from the nice people in the #phing channel on freenode. This has happened a few times, so I thought I should probably look at how to make a new phing plugin, this article shows you how to make the simplest thing I could think of: a simple "hello world" plugin.

She points you to the location to grab the latest version of the tool (the github repository) and how to define a configuration file for your test runs. Then she includes the sample code showing how to create the "HelloTask" plugin. It takes an input value of "name" and displays a greeting when executed. She shows the syntax for defining this in the XML build file and the sample result when executed.

0 comments voice your opinion now!
phing plugin install build configuration xml helloworld task


NetTuts.com:
Pro Workflow in Laravel and Sublime Text
March 15, 2013 @ 09:48:39

NetTuts.com has a new article today for the Laravel developers out there (an up and coming PHP framework) with some handy Sublime Text tips you can use to streamline your workflow.

Not too long ago, I built a handful of generators for Laravel, which ease the process of various tasks. Today, thanks to help from Gaurav Narula, we're turning things up a notch with the release of a new Sublime Text plugin that leverages the power of Artisan and the generators from directly within your editor.

They help you get it installed and running and show (via a screencast) the steps to use it when working in your code. Their examples show the creation of resources (all MVC aspects and configurations), working with Artisan commands, migrations and other bits of code.

0 comments voice your opinion now!
laravel sublimetext editor package generator plugin


Chris Jones:
Quick Debugging of PHP Scripts in Emacs with Geben and Xdebug
January 24, 2013 @ 11:19:47

Chris Jones has a new post showing how you can use Emacs and Xdebug for debugging with the help of the geben plugin.

When you want to test a PHP code snippet quickly, it's handy to do it within your day-to-day environment. For me, this environment is Emacs. The geben package for Emacs provides an interface to the DBGp protocol, such as used by Derick Rethans's standard Xdebug extension for PHP. With the combination of geben and Xdebug, I can quickly and efficiently step through execution of local files, examining code flow and data values.

He includes a ten step process (step 11 is basically "use it") that walks you through the installation of the full stack - PHP, Xdebug and geben - and the configuration changes you'll need to make to get them all working together. Some basic usage instructions are included, but if you want more details on using geben, check out the project's site.

0 comments voice your opinion now!
emacs xdebug tutorial install debug engen plugin


Miro Svrtan:
Debugging Uploadify jQuery plugin with XDebug
August 30, 2012 @ 10:50:01

Miro Svrtan has a quick tip for those using the Uploadify plugin in their application's file uploads - how to enable XDebug debugging on each upload request.

If you ever decided to use Uploadify jQuery plug-in you might have noticed problems with debugging remote PHP code that this plugin relies on. [...] Unfortunately setting this up will not work with Uploadify Flash version since calls to remote server side is not done inside browser but inside flash plugin. [...] Few months ago I found my self blindly debugging it again and remembered that I read somewhere that xdebug parameters can be sent via GET/POST too.

He takes advantage of this fact and appends the "XDEBUG_SESSION_START" and "XDEBUG_SESSION" values in the "scriptData" handler for the Uploadify call. The XDebug session is then started when the script executes and your IDE will receive the results.

0 comments voice your opinion now!
debug uploadify jquery plugin xdebug scriptdata tutorial


MaltBlue.com:
How To Build an Extendible Zend Framework Application
August 16, 2012 @ 12:02:48

On the MaltBlue.com site today there's a new tutorial posted giving you some recommended practices on building an extendible application with the Zend Framework.

Whether you have a big or small budget are time rich or poor, there's always the pressure to build applications with the future in mind. [...] So amongst the multitude of other advice you'll receive throughout your life, building applications that are readily extensible and extendable - in a simple, clean and cost-efficient manner - is essential to keeping input as low as possible, whilst maximising output, and accompanying client satisfaction (or boss satisfaction if you're full-time employed).

He focuses on one aspect of Zend Framework that he's found that helps out the most in keeping his development flexible, resource plugins. These plugins (through use of the Strategy design pattern) can add immediate functionality to your application and be dropped in as needed. He shows how with a simple plugin that allows for simpler file handling for user uploads. The code for the various parts - interface, factory, plugin and resource - are all included.

0 comments voice your opinion now!
zendframework extendible tutorial resource plugin


Zumba Fitness Engineering:
Using Application Events to Hook in Plugins
August 09, 2012 @ 09:23:37

In this recent post on the Zubma Fitness Engineering site, Chris Saylor looks at using events in your applications to hook in plugins to easily (and dynamically) enhance functionality.

In many instances, having a plugin system (even for closed-source applications) is a convenient and safe approach to adding functionality to a product. It minimizes risk by not having to modify the core of the source. In this article, I'll be discussing how we implemented a plugin system for our cart software to allow for plugins.

Its implemented a bit like the Observer design pattern - you "register" the listening event which can then be activated by a "trigger" method with the event's name. These events are stored in a registry (static) so they can be accessed across the application.

0 comments voice your opinion now!
events plugin trigger register tutorial observer



Community Events





Don't see your event here?
Let us know!


community release laravel deployment package series introduction install update framework opinion symfony tips library podcast interview list language api zendserver

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework