Pages

Tuesday, 5 November 2013

A solution to dependency injection into multiple nested ZF2 fieldset classes

After a couple of days spent trying to get the ZF2 Element Manager to let me inject services into my nested fieldsets, I found a solution which seems to work with minimal changes to the Element Manager example or fieldset classes.

Note: My project was slightly different, but, I'll describe my solution in the context of ZF2's own Form Collections documentation. I have also posted this solution in the comments of the ZF website.

Thursday, 1 August 2013

Bootstrap 3 released

If you are a web developer or a frequent web user, you may have heard of Twitter Bootstrap, a style and layout framework created by Mark Otto and Jacob Thornton at Twitter. Since its release, its been used on a huge amount of projects including many blog templates leading to a much more streamlined and consistent web experience for web users.

Well, on July the 27th, the version 3 release candidate was made available to the masses at http://getbootstrap.com
After a few teething issues with bad links and such, the new documentation seems to be working nicely. The framework is drastically different to version 2 to the extent that the developers have decided to prioritise mobile platforms before desktop, but there are still familiar styles and approaches that maintain that Bootstrap feel.

I look forward to seeing how version 3 progresses and seeing how template developers integrate the new framework into their projects.

Thursday, 9 May 2013

Adobe kills Fireworks. Where do we go from here?

Its been a few days now since Adobe announced that they were stopping the Creative Suite and moving 100% to the Creative Cloud (essentially the Master Collection tied heavily to online components). While there are numerous views around the web on the benefits and drawbacks of this decision, one thing that is going to cause a larger gasp from the Adobe user base is the killing off of Fireworks.

Fireworks is the go-to application for quick and easy web graphics, and without it, users will find themselves with some significant hurdles ahead of themselves. Yes, there are some alternatives out there, but there will definitely be a steep learning curve now for the majority of Fireworks users irrespective of which path they now decide to take.

Adobe has justified this decision by claiming that numerous other applications from the Creative Suite (or Creative Cloud) already provide the same functionality that Fireworks does, and so it makes sense to move to those. While that might be true, what they don't say is that you will be required to potentially learn about 3+ additional applications, and that those applications will be chock full of functions that have nothing to do with the kind of simple web work that you will used to do.

I can't see Adobe reversing this decision, but both they and Adobe users should be aware of the implications. After all, we're still having to deal with the bad decisions Adobe have made on the other applications they aquired when they purchased Macromedia.

Thursday, 4 April 2013

Passwords and security

Password security has never been more of an important issue than it is today, and no doubt it will continue to be a very relevant topic for some time to come.

Generally, people who want to know how to tackle this will Google advice on the internet which can be quite helpful, but other advice not so much. It can often leave users frustrated about how to create a password and in quite a few cases they forget their password completely.

Below I provide what I'd term as reasonable practices for the average user.

Thursday, 14 March 2013

Google dropping the RSS ball?

Last Thursday I awoke to the news that Google had decided to retire its Google Reader service. News I was particularly surprised at.

Google have always struck me as a company that stood out from the rest, much the same as Apple have (or had depending on your point of view or OS allegiance). I've watched interviews with its founders, used their services for many years and have been very happy with what I would describe as a reasonably best case example of an integrated online toolbox that caters to the vast majority of daily user requirements.

They have undeniably, one of the best and most well respected search engines on the entire planet. They've also provide an extremely flexible and dependable email service with Gmail. Over recent years, they've also ventured into the social networking scene with Google+ which is a great example, in my humble opinion, of how to do social networking the right way.

Lets look at that last service a little more.

Wednesday, 13 March 2013

Custom jQuery events

I'd been working on some javascript elements recently when I realised I needed to create an interaction or call between two different scripts. These areas would potentially be absent and if present would need data pushed. After discounting some global variable registration ideas, I found that custom jQuery events would fit the bill perfectly.

The following is code for both the event declaration and the triggers.
// do this when triggered
$.bind('onMySelect', function(event, argData){
 console.log(argData);
});

// the trigger
$.event.trigger('onMySelect', 'my test data');
One additional thing seems to be that, if the event declaration isn't present then it silently fails without errors (at least in Firefox my primary development browser of choice).

Friday, 22 February 2013

PHP namespace conventions

With the advent of namespaces in PHP, code is thankfully getting much less complicated by reducing the somewhat messy class naming (though namespacing does affect more than just classes).

As a developer, and stepping into the world of PHP namespacing for the first time, I began to start asking myself about standards and conventions. Many of PHP's features can be interpreted in a number of different ways and namespacing is no different, so a standard would be really helpful, especially in larger projects.

Luckily, a PHP Standards Working Group have put forward a proposal that makes geat sense as a standard to work to. This standard also allows for easily autoloader support which I was also after.

Here's the basic rules:
  • A fully-qualified namespace and class must have the following structure:
    • \<Vendor Name>\(<Namespace>\)*<Class Name>
  • Each namespace must have a top-level namespace ("Vendor Name").
  • Each namespace can have as many sub-namespaces as it wishes.
  • Each namespace separator is converted to a DIRECTORY_SEPARATOR when loading from the file system.
  • Each _ character in the CLASS NAME is converted to a DIRECTORY_SEPARATOR. The _ character has no special meaning in the namespace.
  • The fully-qualified namespace and class is suffixed with .php when loading from the file system.
  • Alphabetic characters in vendor names, namespaces, and class names may be of any combination of lower case and upper case.

More information on the proposed format know as PSR-0 can be found here:

https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md

Tuesday, 19 February 2013

Is hardware becoming throwaway to the extreme?

I've used Apple hardware since the mid 1990's and have seen numerous different itterations including 3 major processor changes. As a result I've become quite accustomed to managing desktop Mac's when they inevitably come to the end of their life.

I would also say that in my experience, most people who regularly use a desktop machine for both work and leisure have a reasonably sound knowledge of how to repair or at the least diagnose things when they go wrong. This has always been a helpful skill to have in my opinion. Over the past few years however, hardware has become significantly closed to the point of rendering DIY maintainance almost impossible.

Tuesday, 12 February 2013

Instant Placeholder for Web Development

One thing that i've found quite useful recently is a simple javascript api that creates placeholders. These are extremely useful when constructing websites to map out a layout without having to add additional CSS or sourcing test images.

Holder.js is hosted on github http://imsky.github.com/holder/

Usage is as simple as:
<img src="holder.js/300x200">

Monday, 4 February 2013

CSS Tips

I've been writing CSS for many, many years now and while there is a fairly basic understanding of the system to many web developers, there are a few things that some may not be familiar with.
For example…

Sunday, 20 January 2013

CodeIgniter refactoring – one day fast-tracking!

I've recently been looking into PHP frameworks again and decided I needed to create an entire website built in CodeIgniter as it was the only real way to see it in action (the tutorial is good but obviously limited). Fortunately, I had a website that fit the bill in terms of size and requirements and although it was fairly far in its development cycle, I decided to take the plunge and refactor it into the CodeIgniter framework.

The end result was a complete refactored site in just one day, plus a much better understanding of how CodeIgniter works in a real world scenario!

Tuesday, 15 January 2013

CodeIgniter Tutorial glitches

As part of general web development, I make a point of checking out the state of the numerous PHP frameworks that are available to the community. Today I had been working through the CodeIgniter tutorial and noticed a couple of glitches (which I found solutions for). In particular, these both relate to the News parts of the tutorial.

Saturday, 12 January 2013

Magento Go UK postcode matching

I was recently asked to look into a problem a client had with delivery rates on the Magento Go service. Magento Go for those who don't know, is a slimmed down version of a large and enterprise level open source e-commerce system, and is hosted/maintained/supported by Magento themselves.

This particular problem with delivery rates was an issue with postcode recognition, in particular, UK postcodes (although I suspect that the issue might happen with any field used in the same way). In addition to the postcodes not being recognised, the country field wasn't either.