Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Form helper - form_open first param as array #1579

Closed
proseol opened this Issue · 1 comment

2 participants

@proseol

Hello, CI developers!
In ‘form’ helper we have the function form_open($url, $params, $hidden)

Theoretically there should be possible to put $url as array, with url segments. This should work, because if $url is not a full url address, then helper uses
(form_helper.php, line 55)
site_url($action)
which supports an array version.
Only the problem, why cannot we use this:
(form_helper.php, line 53)
strpos($action, ‘://’) - strpos function can receive only string $action, not an array.

So, what do I offer:
instead of

if ($action && strpos($action, '://') === FALSE)
{
$action = $CI->config->site_url($action);
}

Let`s use:

if ($action && (is_array($action) || strpos($action, '://') === FALSE))
{
$action = $CI->config->site_url($action);
}

What do you think?
May be there is sense to put this little modification in the next CI releases?

@narfbg
Owner

This function is not intended to handle such arrays. If you want to change it - submit a pull request, but I personally don't support the idea.

@narfbg narfbg closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.