open a form

@param   string  Type of form, get / post / file (adds as post and adds enctype) etc...
@param   string  Action for the form
@param   array   Array of extra params
@return  string
184341
public function open($method, $action = '', $attr = array())
    {
        // check if they wish to send a file
        // default to post method and add the enctype needed to send files
        $method = strtolower($method);
        if ($method === 'file') {
            $method = 'post';
            $attr['enctype'] = 'multipart/form-data';
        }

        if (! in_array($method, array('post', 'get'))) {
            $method = 'post';
        }

        $attr['method'] = $method;
        $attr['action'] = $action;

        return $this->Html->tag('form', $attr);
    }
445999
public function postRequest( $action, array $params, EditInfo $editInfo = null ) {
		if ( $editInfo !== null ) {
			$params = array_merge( $this->getEditInfoParams( $editInfo ), $params );
		}

		$params['token'] = $this->api->getToken();
		return $this->api->postRequest( new SimpleRequest( $action, $params ) );
	}
269201
public function open($options = [])
    {
        $attributes = [];

        if ($this->isMode(self::MODE_EDIT)) {
            $this->addHiddenField((new Hidden('_method'))->value('PUT'));
        }

        $this->addRedirectUrlField();

        $attributes['action'] = $this->getAction();
        $attributes['method'] = Arr::get($options, 'method', 'post');
        $attributes['accept-charset'] = 'UTF-8';

        $attributes['class'] = Arr::get($options, 'class');

        if ($this->hasFile()) {
            $attributes['enctype'] = 'multipart/form-data';
        }

        $html = [];
        foreach ($attributes as $name => $value) {
            $html[] = "$name=\"$value\"";
        }

        return '<form '.implode(' ', $html).' pjax-container>';
    }
1252486
public function open($uri, $mode='r+', $lock=false)
    {

        if (is_resource($uri)) {
            return new ResourceStream($uri, $lock);
        }

        if (!Type::isStringLike($uri) && !$uri instanceof UrlContract) {
            throw new TypeException('$uri has to be string or ' . Type::of($uri));
        }

        $uri = $uri instanceof UrlContract ? $uri : new Url($uri);

        if ($uri->scheme == 'http' || $uri->scheme == 'https' && class_exists(HttpFileStream::class)) {
            return new HttpFileStream($uri, $mode, $lock);
        }

        return new FileStream($uri, $mode, $lock);
    }
817863
public static function searchForm($action, $method = 'post', $htmlOptions = array())
    {
        self::addCssClass('form-search', $htmlOptions);
        $inputOptions = TbArray::popValue('inputOptions', $htmlOptions, array());
        $inputOptions = TbArray::merge(array('type' => 'text', 'placeholder' => 'Search'), $inputOptions);
        $name = TbArray::popValue('name', $inputOptions, 'search');
        $value = TbArray::popValue('value', $inputOptions, '');
        $output = self::beginFormTb(self::FORM_LAYOUT_SEARCH, $action, $method, $htmlOptions);
        $output .= self::searchQueryField($name, $value, $inputOptions);
        $output .= parent::endForm();
        return $output;
    }
912159
private function createActions($actions)
    {
        $actionBuilders = [];

        foreach ($actions as $action) {
            switch (strtolower($action->type)) {
                case Action::TYPE_POSTBACK:
                    $actionBuilders[] = new PostbackTemplateActionBuilder($action->label, $action->value);
                    break;
                case Action::TYPE_URI:
                    $actionBuilders[] = new UriTemplateActionBuilder($action->label, $action->value);
                    break;
                default:
                    $actionBuilders[] = new MessageTemplateActionBuilder($action->label, $action->value);
            }
        }

        return $actionBuilders;
    }
677194
public function getExtraFormTypesOptionsAction(
        $_format,
        $type,
        ExtraFormTypeRegistryInterface $registry,
        FormFactoryInterface $formFactory,
        ExtraFormBuilderInterface $extraFormBuilder
    ) {
        if (!($registry->hasType($type))) {
            throw new NotFoundHttpException(sprintf(
                'The Type `%s` was not found',
                $type
            ));
        }

        $view = View::create()->setFormat($_format);
        $options = $registry->getType($type)->getExtraFormOptions();

        if ('html' === $_format) {
            $form = $extraFormBuilder
                ->build(
                    $options,
                    array(),
                    null,
                    $formFactory->createNamedBuilder(
                        null,
                        'form',
                        null,
                        array('csrf_protection' => false)
                    )
                )
                ->getForm()
            ;

            $view
                ->setData($form->createView())
                ->setTemplate('IDCIExtraFormBundle:Api:form.html.twig')
                ->setTemplateVar('form')
            ;
        } else {
            $view->setData($options);
        }

        return $this->handleView($view);
    }
960534
protected function processAction(Request $request, $action = "POST", $resource = array())
    {
        $form = $this->processForm($request, $action, $resource);

        if ($form->isValid()) {
            $resource = $form->getData();

            $this->getResourceManager()->persist($resource);

            $view = $this->view($resource, \FOS\RestBundle\Util\Codes::HTTP_OK);

            return $this->handleView($view);
        }

        $view = $this->view($form, \FOS\RestBundle\Util\Codes::HTTP_BAD_REQUEST);

        return $this->handleView($view);
    }
377396
protected function post_data($action)
  {
      $this->post['METHOD'] = $action;
      $this->post['VERSION'] = $this->version;
      $this->post['PWD'] = $this->options['password'];
      $this->post['USER'] = $this->options['login'];
      $this->post['SIGNATURE'] = $this->options['signature'];

      return $this->urlize($this->post);
  }
827704
def __process_action(self, action, file_type):
        
        if getattr(action, "inject_url", False):
            self.__inject_url(action, file_type)
        if getattr(action, "inject_ssh_properties", False):
            self.__inject_ssh_properties(action)
941622
public function openFilterForm($usePost = false) {
		$this->_setFlagUsePost($usePost);
		$type = 'get';
		$dataToggle = 'pjax-form';
		if ($this->_getFlagUsePost()) {
			$type = 'post';
			$dataToggle = 'ajax-form';
		} else {
			$filterData = $this->getFilterData();
			if (!empty($filterData)) {
				$this->setFilterInputData($filterData);
			}
			$conditions = $this->getFilterConditions();
			if (!empty($conditions)) {
				$this->setFilterInputConditions($conditions);
			}
		}

		$options = [
			'data-toggle' => $dataToggle,
			'type' => $type,
		];
		$optionsDefault = $this->_getOptionsForElem('openFilterForm');
		$result = $this->ExtBs3Form->create(null, $options + $optionsDefault);

		return $result;
	}
299510
public function listByTypeAction(Request $request, $access, FileType $fileType)
    {
        $sm = $this->container->get('sakonnin.files');
        $files = $messageType->getMessages(true);
        if ($this->isRest($access)) {
            return $this->returnRestData($request, $files, array('html' =>'BisonLabSakonninBundle:Message:_index.html.twig'));
        }
        return $this->render('BisonLabSakonninBundle:SakonninFile:index.html.twig',
            array('entities' => $files));
    }
574109
public function buildForm($id = '', $action = '', $async = false, $fileUpload = false, $attributes = [])
    {
        // Create form control
        $form = new Form($this->getHTMLDocument(), $this, $attributes);
        $form->build($id, $action, $async, $fileUpload);

        return $form;
    }
1284674
public function open(array $options = array())
    {
        $method = isset($options['method']) ? $options['method'] : 'post';

        // We need to extract the proper method from the attributes. If the method is
        // something other than GET or POST we'll use POST since we will spoof the
        // actual method since forms don't support the reserved methods in HTML.
        $attributes['method'] = $this->getMethod($method);

        $attributes['accept-charset'] = 'UTF-8';

        // If the method is PUT, PATCH or DELETE we will need to add a spoofer hidden
        // field that will instruct the Symfony request to pretend the method is a
        // different method than it actually is, for convenience from the forms.
        $append = $this->getAppendage($method);

        if (isset($options['files']) && $options['files']) {
            $options['enctype'] = 'multipart/form-data';
        }

        // Finally we're ready to create the final form HTML field. We will attribute
        // format the array of attributes. We will also add on the appendage which
        // is used to spoof requests for this PUT, PATCH, etc. methods on forms.

        foreach ($this->reserved as $reserved) {
            if (array_key_exists($reserved, $options)) {
                unset($options[$reserved]);
            }
        }

        $attributes = array_merge($attributes, $options);

        // Finally, we will concatenate all of the attributes into a single string so
        // we can build out the final form open statement. We'll also append on an
        // extra value for the hidden _method field if it's needed for the form.
        $attributes = $this->html->attributes($attributes);

        return '<form'.$attributes.'>'.$append;
    }
820907
private static IAction createAction(String action) {
        IAction actn = null;
        
        if (!StringUtils.isEmpty(action)) {
            if ((actn = ActionRegistry.getRegisteredAction(action)) == null) {
                actn = ActionUtil.createAction(null, action);
            }
        }
        
        return actn;
    }
1148598
public function renderFormAction(
        Action $action,
        Request $request,
        FormInterface $form,
        $data = null,
        array $viewParameters = []
    ): Response {
        $viewParameters = array_merge($this->getViewParameters($action, $request, $form, $data), $viewParameters);

        return $this->renderAction($action, $viewParameters);
    }
1084042
public function addAction()
    {
        $parent = $this->params()->fromRoute('parent');
        if (! is_numeric($parent)) {
            $this->flashMessenger()->addMessage(
                $this->scTranslate('The file location was not specified.')
            );
            return $this->redirect()
                ->toRoute('sc-admin/content-manager')
                ->setStatusCode(303);
        }

        $form = $this->getFileAddForm();
        $form->setAttribute(
            'action',
            $this->url()->fromRoute(
                'sc-admin/file/add',
                ['parent' => $parent]
            )
        );
        $request = $this->getRequest();

        if ($request->isPost()) {
            $post = array_merge_recursive(
                $request->getPost()->toArray(),
                $request->getFiles()->toArray()
            );
            $form->setData($post);
            if ($form->isValid()) {
                try {
                    $transfer = $this->getFileTransfer();
                    $data = $transfer->receive($form->getData());
                    $fileIds = $this->getFileService()->makeFiles(
                        $parent, $data
                    );
                    return $this->redirect()->toRoute(
                        'sc-admin/file/edit',
                        ['id' => implode(',', $fileIds)]
                    );
                } catch (Exception $e) {
                    if (isset($data)) {
                        $transfer->rollBack($data);
                    }
                    if ($e instanceof RuntimeException) {
                        $this->flashMessenger()->addMessage($e->getMessage());
                        return $this->redirect()
                            ->toRoute('sc-admin/content-manager')
                            ->setStatusCode(303);
                    } elseif (DEBUG_MODE) {
                        throw new DebugException(
                            $e->getMessage(),
                            $e->getCode(),
                            $e
                        );
                    }
                }
            }
        }
        return new ViewModel([
            'form' => $form,
        ]);
    }