You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I remembered using this with various parts of the framework that it felt natural and intuitive to use it with Form::setAction as well, but turns out you can't. I don't see any reason why Form::setAction wouldn't act as a shortcut for Phalcon\Mvc\Url so we can do something like:
In case we agree on this one, I propose to consider implementing it using variadic function and argument unpacking/splat operator instead of call_user_func_array, if it is supported in Zephir ofc. Maybe we should do some benchmarking first?
publicfunctionsetAction(...$args)
{
$argsCount = count($args);
if ($argsCount == 1 && is_string($args[0])) {
$this->action = $args[0];
return$this;
}
if ($argsCount > 0) {
$this->action = $this->url->get(...$args);
return$this;
}
thrownew \InvalidArgumentException('Form::setAction requires at least one argument');
}
The text was updated successfully, but these errors were encountered:
Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalconphp.com/post/github-closing-old-issues
I remembered using this with various parts of the framework that it felt natural and intuitive to use it with
Form::setAction
as well, but turns out you can't. I don't see any reason whyForm::setAction
wouldn't act as a shortcut forPhalcon\Mvc\Url
so we can do something like:In case we agree on this one, I propose to consider implementing it using variadic function and argument unpacking/splat operator instead of
call_user_func_array
, if it is supported in Zephir ofc. Maybe we should do some benchmarking first?The text was updated successfully, but these errors were encountered: