If you use the form helper from CakePHP 1.2 to generate an input field, it automatically creates a label for the input field. So this snippet:

echo $form->input('Project/name');

will generate the following HTML code:

<div class="input">
    <label for="ProjectName">Name</label>
    <input name="data[Project][name]” type=”text” value=”" id=”ProjectName” />
</div>

But sometimes you don’t want a label. How can you accomplish that? My first two attempts failed, the label “Name” was still shown:

// first attempt
echo $form->input('Project/name', array('label' => ''));
// second attempt
echo $form->input('Project/name', array('label' => null));

With the third attempt I was then successful, and the label disappeared:

echo $form->input('Project/name', array('label' => false));

In retrospect the solution is logical, but sometimes you don’t see the obvious solution ;-)