My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
CakeForms  
Updated Feb 4, 2010 by tobiasz....@gmail.com

CakeForms plugin automatically converts HTML markup forms into executable PHP code using CakePHP's default FormHelper. It's used to rapidly mix designed template with CakePHP form controls. It also handles error messages.

It's use is quite simple

// load plugin
->plugin('CakeForms')
// find form in the template
->find('form')
  // convert form
  ->formToCakeForm(
    array('Post', array('action' => 'edit')), $form
  );

Sample output (see full file)

<div class="input textarea">
<label for="body">Body</label><?php 
 print $form->error('body', null, array (
  'before' => '<p class="errorField">',
  'class' => 'errorField',
  'after' => '</p>',
));
                        print $form->input('body',
                                array (
  'type' => 'textarea',
  'div' => '',
  'legend' => false,
  'label' => false,
  'id' => 'PostBody',
)
                        ); 
 ?>
</div>

For further reading see


Sign in to add a comment
Powered by Google Project Hosting