Skip to content

Instantly share code, notes, and snippets.

@weierophinney
Created September 6, 2012 18:11
Show Gist options
  • Save weierophinney/3659074 to your computer and use it in GitHub Desktop.
Save weierophinney/3659074 to your computer and use it in GitHub Desktop.
annotation for radio element
<?php
use Zend\Form\Annotation;
class Foo
{
/**
* @Annotation\Type("Zend\Form\Element\Radio")
* @Annotation\Options({"label": "Your Choice:", "value_options":{"foo":"bar", "bar":"baz"}})
*/
public $choice;
}
@jamescarr
Copy link

Figured it out... the correct way is this:

<?php

use Zend\Form\Annotation;

class Foo
{
    /**
     * @Annotation\Type("Zend\Form\Element\Radio")
     * @Annotation\Options({
     *          "label":"Here are your choices:",
     *          "value_options":{"foo":"bar", "bar":"baz"}
     * })

     */
    public $choice;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment