jmunguia
jmunguia

Reputation: 11

How to get an specific input using FormHelper

Is there a way to do this with FormHelper:

<button type="submit" class="btn"><i class="icon-search"></i> Sign in</button>

I tried it using $this->Form->end(); but it doesn't work as I wanted.

Upvotes: 1

Views: 60

Answers (2)

thaJeztah
thaJeztah

Reputation: 29047

Did you read the manual? Seems like this is what you're looking for;

Creating buttons and submit elements

Something like this should probably work;

echo $this->Form->button(
    '<i class="icon-search"></i> Sign in',
    array('class' => 'btn', 'escape' => false)
);

Upvotes: 5

Dave
Dave

Reputation: 29131

Have you tried this?

?>
<button type="submit" class="btn"><i class="icon-search"></i> Sign in</button>
<?php

Remember - CakePHP is there to help make things easier. If you have an already-simple task, there's no reason to complicate it.

Upvotes: 0

Related Questions