启用intl.so扩展名之后的表单上的PHP错误消息

| 这是我的控制器:
<?php

namespace Home\\JoinBundle\\Controller;

use Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller;
use Home\\JoinBundle\\Entity\\User;

class DefaultController extends Controller
{
    public function indexAction()
    {
        $user = new User;
        $user->fname;
        $user->lname;
        $user->bday;

         $form = $this->get(\'form.factory\')
                 ->createBuilder(\'form\', $user)
                 ->add(\'fname\', \'text\', array(\'label\' => \'First Name: \'))
                 ->add(\'lname\', \'text\', array(\'label\' => \'Last Name: \'))
                 ->add(\'bday\', \'birthday\',  array(\'input\' => \'array\', \'widget\' => \'choice\'))
                 ->getForm();


        return $this->render(\'HomeJoinBundle:Default:index.html.twig\', array(\'form\' => $form->createView()));
    }

}
    
已邀请:
        奇怪的是,默认值不起作用,但是尝试一下(做默认情况下应该做的同样的事情,如http://symfony.com/doc/current/reference/forms/types中所述) /birthday.html
$dater = new \\IntlDateFormatter();
$form = $this->get(\'form.factory\')
             ->createBuilder(\'form\', $user)
             ->add(\'fname\', \'text\', array(\'label\' => \'First Name: \'))
             ->add(\'lname\', \'text\', array(\'label\' => \'Last Name: \'))
             ->add(\'bday\', \'birthday\',  array(\'input\' => \'array\', \'widget\' => \'choice\', \'months\' => $dater))
             ->getForm();
    

要回复问题请先登录注册