echo $form->buttons();
?>
		<?php 
echo $form->close();
?>
		
		<h4>Raw POST data:</h4>
		<?php 
var_dump($_POST);
?>
	
		<hr />
	
		<?php 
// Check form validity
if ($form->is_bound() && $form->is_valid()) {
    ?>
			<h4>Processed and cleaned form data:</h4>
			<?php 
    $form->report();
    ?>
		<?php 
} elseif ($form->has_errors()) {
    ?>
			<h4>Errors:</h4>
			<?php 
    var_dump($form->get_errors());
    ?>
		<?php 
} else {
    ?>
Exemple #2
0
        $this->message = new Phorm_Field_Textarea('Message', 5, 40, array('required'));
        $this->notify = new Phorm_Field_Checkbox('Reply notification');
        // Add some help text
        $this->notify->help_text('Email me when my comment receives a response.');
        $this->email->help_text('We will never give out your email address.');
    }
    public function report()
    {
        var_dump($this->cleaned_data());
    }
}
// Set up the form
$post_id = 42;
$form = new CommentForm('post', false, array('post_id' => $post_id, 'notify' => true));
// Check form validity
$valid = $form->is_valid();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<title>Comment Form example for Phorm</title>
		<link rel="stylesheet" href="assets/style.css" type="text/css" />
	</head>
	<body>
		<h1>Add a comment</h1>
		<?php 
echo $form->open();
?>
		<?php 
if ($form->has_errors()) {