Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control macro is bundling arguments to an array if one of the arguments is an array #1206

filiplikavcan opened this issue Aug 17, 2013 · 0 comments


None yet
1 participant
Copy link

commented Aug 17, 2013

# Use case 1 (primitive arguments)

{control aForm, 1, 'foo', true}

# will properly generate 

$_ctrl->render(1, 'foo', true)

The next case should also generate call to render method with three arguments.

# Use case 2 (array argument)
{control aForm, 1, 'foo', array('foo' => 'bar')}

# BUG: the macro will wrap all the arguments into one array:

$_ctrl->render(array(1, 'foo', array('foo' => 'bar'))

This is caused by a condition which determines whether or not to strip the wrapping array just by searching for '=>' substring. This condition covers the use case 3 (bellow) when an implicit array is used as macro argument. However it causes the use case mentioned above not to work properly.

# Use case 3 (implicit array)
{control aForm, 1, 'foo', 'foo' => 'bar'}
$_ctrl->render(array(1, 'foo', 'foo' => 'bar'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.