1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Zend Framework with XAMPP

Discussion in 'PHP' started by altergothen, Nov 5, 2008.

  1. #1
    Hi there

    How do I get the Zend framework to work with XAMPP under Windows?

    I am running XAMPP 1.6.4 for windows.
    I downloaded ZendFramework-1.6.2 and extracted the archive into my XAMPP directory.
    I edited my php.ini file and re-started Apache
    include_path = ".;D:\xampp\php\pear\;D:\xampp\ZendFramework-1.6.2\library\Zend\"

    It doesn't seem to work?
    Any suggestions?
    Thanks
     
    altergothen, Nov 5, 2008 IP
  2. streety

    streety Peon

    Messages:
    321
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #2
    All the zend classes begin with Zend_ so to get the autoloader working correctly you would be better setting your include path to include_path = ".;D:\xampp\php\pear\;D:\xampp\ZendFramework-1.6.2\library\"

    There is no need to go down that one extra layer into the Zend folder. This also allows you to easily load custom classes by putting them in the library folder.

    I don't know whether this is what is causing your difficulties but it is one issue. Without knowing how you are calling the classes there may be other issues.
     
    streety, Nov 5, 2008 IP
  3. altergothen

    altergothen Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks alot :)

    I am brand new to the Zend Framework
    I'm still trying to figure out how to call zend classes.
    Do you perhaps have a testing code snippet that I could use to try?

    The script I'm using to test zend at the moment looks like this:

    <?php
    class forms_ContactForm extends Zend_Form
    {
    public function __construct($options = null)
    {
    parent::__construct($options);
    $this->setName('contact_us');

    $title = new Zend_Form_Element_Select('title');
    $title->setLabel('Title')
    ->setMultiOptions(array('mr'=>'Mr', 'mrs'=>'Mrs'))
    ->setRequired(true)->addValidator('NotEmpty', true);

    $firstName = new Zend_Form_Element_Text('firstName');
    $firstName->setLabel('First name')
    ->setRequired(true)
    ->addValidator('NotEmpty');

    $lastName = new Zend_Form_Element_Text('lastName');
    $lastName->setLabel('Last name')
    ->setRequired(true)
    ->addValidator('NotEmpty');

    $email = new Zend_Form_Element_Text('email');
    $email->setLabel('Email address')
    ->addFilter('StringToLower')
    ->setRequired(true)
    ->addValidator('NotEmpty', true)
    ->addValidator('EmailAddress');


    $submit = new Zend_Form_Element_Submit('submit');
    $submit->setLabel('Contact us');

    $this->addElements(array($title, $firstName,
    $lastName, $email, $submit));

    }
    }

    ?>
     
    altergothen, Nov 5, 2008 IP