0

This is my form

<?php
namespace Home\Form;

use Zend\Form\Form;

class CheckPriceForm extends Form
{

    public function __construct($name = null)
    {
        parent::__construct();

        $this->add(array(
            'name' => 'distance',
            'type' => 'Zend\Form\Element\Number',
            'options' => array(
                'label' => 'Distance',
            ),
        ));

        $this->add(array(
            'name' => 'weight',
            'type' => 'Zend\Form\Element\Number',
            'options' => array(
                'label' => 'Weight',
            ),
        ));

        $this->add(array(
            'name' => 'submit',
            'type' => 'Submit',
            'attributes' => array(
                'value' => 'Check Price',                
            ),
        ));
    }
}

It is give following error

/home/dinuka/workspace/free_courier/vendor/ZF2/library/Zend/I18n/Validator/Float.php:49

Zend\I18n\Validator component requires the intl PHP extension

When i replace Email for Number it is working. Please help me.

Dinuka Thilanga
  • 4,220
  • 10
  • 56
  • 93
  • 1
    Try adding the Required Intl extension, Few HTML 5 based elements/validations are not fully supported till they are configured, and few dont work on all browsers – noobie-php Aug 17 '13 at 18:08
  • 1
    surely you can just google the message? it's pretty self explanitory. http://php.net/manual/en/intl.setup.php – Andrew Aug 19 '13 at 07:38

1 Answers1

5

intl extension is missing on your server. so you need to install it.

If you are using Linux try using the following commands

sudo apt-get install php5-intl

You then need to restart Apache

sudo service apache2 restart

For Windows

https://stackoverflow.com/a/1451770/1508276

Community
  • 1
  • 1
Salman Raza
  • 76
  • 1
  • 3