如何在Zend表单注释中更改表单文本框值?

时间:2015-04-30 16:45:45

标签: php forms zend-framework annotations

我有以下注释例外。我需要在zend控制器中更改表单值

$ atom -h

所以在控制器中我有:

/** 
* @Annotation\Hydrator("Zend\Stdlib\Hydrator\ObjectProperty")
* @Annotation\Name("LoginForm")
* 
*/
class User
{
    /** Some comment to make this annotation work
    * @Annotation\Type("Zend\Form\Element\Text")
    * @Annotation\Required({"required":"true" })
    * @Annotation\Filter({"name":"StripTags"})
    * @Annotation\Options({"label":"Firstname: "})
    * @Annotation\Attributes({"id":"FirstnameId"})
    */
    public $username;

现在我如何设置或更改用户字段的值? 我试过了$user = new User(); $builder = new AnnotationBuilder(); $this->form = $builder->createForm($user);

但它没有用?

0 个答案:

没有答案