Example #1
0
 /**
  * Creates a new form with the options stored in the given context
  *
  * @param  FormContextInterface $context
  * @param  string $name
  * @param  array $options
  * @return Form
  */
 public static function create(FormContextInterface $context, $name = null, array $options = array())
 {
     return new static($name, array_merge($context->getOptions(), $options));
 }
Example #2
0
 /**
  * Creates a new form with the settings stored in the default context
  *
  * @param  string $name        The name for the form
  * @param  array|object $data  The data displayed and modified by the form
  * @return Form                The new form
  */
 public function getForm($name, $data = null)
 {
     return $this->defaultContext->getForm($name, $data);
 }