Potential Fix for LightHouse Ticket #3936

I believe I found a fix for this issue. I am here at #CakeFest2013 and during the #HourOfContribution I ran across this issue.

Currently in CakePHP 2.4 on Line 1522 - 1524 you can see the following code:

@@@ php
if ($label) {
	$optTitle = $this->Html->useTag('label', $tagName, '', $optTitle);
}
@@@

The $label variable here the is the $label array passed into the input method in Sethathi example above. The problem is that the $label array is completely ignored and instead a label is created using the HtmlHelper->useTag method.

I have what I believe is a fix for this issue but it hasn't been extensively tested. I tested against Sethathi example in the ticket and it produced the correct result.

The fix is simple. We detect if an array is passed in and then send it to the FormHelper label method instead of the HtmlHelper useTag method. The FormHelper label methods accepts an options array, so we pass in the $label array.

This will probably need to be fixed for checkbox also

"ask":https://cakephp.lighthouseapp.com/users/235987 helped me with this fix
Format to CakePHP code sniffs
Remove a default helper from View.

This goes back to the days of yore and combined with
b8320fdbb7fc83d3d9e2b72cd418cf82ae52fdae it causes issues. The specific
issue at hand was testing a helper that uses other aliased helpers
(HtmlHelper specifically). The core helper would always be loaded
instead of the aliased one.
Fixed identing and spacing
Merge pull request #1599 from mvdriel/fix-identing

Fixed identing and spacing
Load helpers of email view
Merge pull request #1600 from aleho/master

Load helpers of email view
Fix invalid CSS in fixture files.

Fixes #4041
Reorder inflection rules.

Place rules for words like 'archives' and 'relatives' before words like
'knives'.

Fixes #4040
Plural of breif is breifs not breives
Merge pull request #1605 from robmcvey/inflector

Plural of brief is briefs not brieves
Use FormHelper->label instead of HtmlHelper->useTag

Implementing suggested fix by mark_story
Postgres::truncate(): Delete disused code.
Fix log classname in skeleton

Fixes "logger class File does not implement a write method."
It probably tries to use the utility File class instead of the logger
Merge pull request #1607 from chadrien/patch-1

Fix log classname in skeleton
performance improvements in CakeTime::timeAgoInWords Edit

- rearranges code to move return statements before otherwise dead code
- only do translation if translated string is actually used
Merge pull request #1609 from Schlaefer/patch-1

performance improvements in CakeTime::timeAgoInWords
Dropping 'Log' suffix from log configs as per change in cb24dbb084.

Reverts regressive change done in 7e28636a72.
Update Model/Behaviors callback signature to be PHP5.4+ compliant.
Merge pull request #1597 from aread22/master

Potential Fix for LightHouse Ticket #3936

Fixes #3936