Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-02-2008, 11:38 PM
Junior Member
 
Join Date: May 2008
Posts: 1
Default i can't disply form

dear all,
i am new in zend i have this code and try to use zend form and nothing in my browser i can't see any thing please help

my directory like this
/a.php
/Zend

it just print End of file

<?php
require_once 'Zend/Form.php';
require_once 'Zend/Config.php';
require_once 'Zend/Validate.php';
require_once 'Zend/Validate/Alnum.php';
require_once 'Zend/Filter.php';
require_once 'Zend/Loader.php';
require_once 'Zend/View.php';


$form = new Zend_Form;
$form->setAction('./')
->setMethod('post');
$form->setAttrib('id', 'login');

// Passing a form element type to the form object:
$form->addElement('text', 'username');
$username = new Zend_Form_Element_Text('username');

// Passing a validator name:
// Pass a pattern
// Make this element required
$username->addValidator('alnum')
->addValidator('regex', false, array('/^[a-z]/'))
->setRequired(true)
->addFilter('StringToLower');

// Assuming a view object has been previously set via setView():
echo $form;


if (!$form->isValid($_POST)) {
echo $form ;

// or assign to the view object and render a view...
echo $this->view->form = $form;
return $this->render('form');
}

echo "<br>End of file";
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:59 PM.