views:

150

answers:

1

How can i change the templating of a form in sfDoctrineGuardPlugin?

That is, I need to change the html (class, id) of the input elements (username, password) of a login form provided by sfDoctrineGuardPlugin.

I've changed apps/app_name/modules/sfGuardAuth/templates/singinSuccess.php, but it then just echoes $form (I need to change contents of that part - $form):

  <form action="<?php echo url_for('@sf_guard_signin') ?>" method="post">
    <table>
       <?php echo $form ?>
    </table>
    <input type="submit" class="go_button" value="ir" />
    <a href="<?php echo url_for('@sf_guard_password') ?>"><?php echo __('Forgot your password?') ?></a>
  </form>

(It really should be something like changing a _form.php => I cant find this, though :S)

Thank you all for any answers provided =)

+1  A: 

In the sign in form class (forget it's name), there will be something like:

'username' => new sfWidgetFormInput(array(), array())

Modify that to:

'username' => new sfWidgetFormInput(array(), array('id' => 'jibbly', 'class' => 'wibbly'))
Coronatus
Great! Thanks, Coronatus. That was helpful. Any trick on how to modify completly the html produced by the plugin?In the extra docs all they say is this:<quote>If you want to change the actual HTML emitted, you can obtain the formatter and override whatever settings are desired $this->getWidgetSchema()->getFormFormatter()->setRowFormat( "<tr>\n <th align=\"right\">%label%</th>\n <td>%error%%field%%help%%hidden_fields%</td>\n</tr>\n"</quote>But I would like to completly write a _form.php template to render it. Don't know how to do it, though :SThx
Rui Carvalho