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

SitePoint PHP Blog:
Creating Custom Field Formatters in Drupal 8
March 12, 2015 @ 12:29:01

The SitePoint PHP blog has a new tutorial posted today showing how to create custom field formatters in a Drupal 8 application. Custom formatters allow you to enhance the current functionality of objects in the application and extend them with additional functionality.

With the introduction of annotated plugins, a lot has changed in Drupal 8. We have a more streamlined approach to describing and discovering pieces of functionality that extend the core. Along with many other components, the former Field API (part of the larger and consolidated Entity API) is now based on plugins. In this tutorial we will go through defining a custom field formatter for an existing field (image). What we want to achieve is to make it possible to display an image with a small caption below it. This caption will be the title value assigned to the image if one exists.

They start with a new custom module, starting with just the YAML configuration. Then they help you create the field formatter as a plugin in the "Plugin/Field/FieldFormatter" namespace (code included). They explain how this code works and show how to add it as a hook to make it available to the template layer. Finally they show it in use and how it places the title value into the image caption in the result.

0 comments voice your opinion now!
drupal8 custom field formatter tutorial plugin image title

Link: Creating Custom Field Formatters in Drupal 8

Ibuildings techPortal:
Zend Studio formatted for Zend Framework and ATK
March 18, 2010 @ 12:49:49

On the Ibuildings techPortal site today Ivo Jansch takes a look at a type formatter they've created to work with Zend Studio to more correctly format your code as per the official coding standard for the Zend Framework.

One problem we have with the current versions of Zend Studio is that its default Zend Framework formatter is not consistent with the official Zend Framework coding standard. Luckily, that can be easily fixed. Sandy Pleyte, one of our developers, created a formatting file for Zend Studio that does adhere to the formal standard. There might be a few issues here and there but we've found it to work much better than the default one in Zend Studio.

If you're a Zend Studio user and want to get a little less frustrated at the formatting it uses for your applications, download the tool and follow the instructions in the post to get it working in your IDE.

0 comments voice your opinion now!
zendframework zendstudio formatter download



Community Events

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


version laravel interview example framework community security series api podcast php7 list introduction library release voicesoftheelephpant extension laravel5 opinion language

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