Cake\View\Helper\FormHelper::_formUrl PHP Метод

_formUrl() защищенный Метод

Create the URL for a form based on the options.
protected _formUrl ( Cake\View\Form\ContextInterface $context, array $options ) : string
$context Cake\View\Form\ContextInterface The context object to use.
$options array An array of options from create()
Результат string The action attribute for the form.
    protected function _formUrl($context, $options)
    {
        if ($options['action'] === null && $options['url'] === null) {
            return $this->request->here(false);
        }
        if (is_string($options['url']) || is_array($options['url']) && isset($options['url']['_name'])) {
            return $options['url'];
        }
        if (isset($options['action']) && empty($options['url']['action'])) {
            $options['url']['action'] = $options['action'];
        }
        $actionDefaults = ['plugin' => $this->plugin, 'controller' => $this->request->params['controller'], 'action' => $this->request->params['action']];
        $action = (array) $options['url'] + $actionDefaults;
        $pk = $context->primaryKey();
        if (count($pk)) {
            $id = $context->val($pk[0]);
        }
        if (empty($action[0]) && isset($id)) {
            $action[0] = $id;
        }
        return $action;
    }