Thread: Zend Form Issue
View Single Post
  #1 (permalink)  
Old 04-08-2008, 06:17 AM
Jhorra Jhorra is offline
Member
 
Join Date: Jun 2007
Posts: 33
Default Zend Form Issue

I'm getting an odd error when trying to use Zend_Form:
Fatal error: Class 'Zend_Form_Element_Text' not found in /home/tplgame/public_html/application/forms/RegisterForm.php on line 11

Here's my form itself, as you can see it's very basic and definitely shouldn't give this error.
PHP Code:
<?php
Zend_Loader
::loadClass('Zend_Form');

class 
RegisterForm extends Zend_Form
{
    public function 
__construct($options null)
    {
        
parent::__construct($options);
        
$this->setName('register');
        
        
$username = new Zend_Form_Element_Text('username');
        
$username->setLabel('Username')
            ->
setRequired(true)
            ->
setValidators('NotEmpty');
            
        
$username = new Zend_Form_Element_Text('email');
        
$username->setLabel('Email Address')
            ->
setRequired(true)
            ->
setValidators('NotEmpty');
            
        
$password = new Zend_Form_Element_Password('password');
        
$password->setLabel('Password')
            ->
setRequired(true)
            ->
setValidators('NotEmpty');
            
        
$confirm_password = new Zend_Form_Element_Password('confirm_password');
        
$confirm_password->setLabel('Confirm Password')
            ->
setRequired(true)
            ->
setValidators('NotEmpty');
            
        
$submit = new Zend_Form_Element_Submit('submit');
        
$submit->setLabel('Register');
        
        
$this->addElements(array($username$email$password$confirm_password$submit));
    }
}
Reply With Quote