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

Allows to use a two level array data on 'data' parameter for Form->postLink() #2894

Closed
wants to merge 1 commit into from
Closed

Allows to use a two level array data on 'data' parameter for Form->postLink() #2894

wants to merge 1 commit into from

Conversation

tranfuga25s
Copy link
Contributor

This allow to make use of

echo $this->Form->postLink( " Export to PDF", array( 'action' => 'imprimir.pdf' ),array( 'data' => $this->Paginator->params() ) );
and recive an array such as:
array(
    'page' => '1',
    'current' => '127',
    'count' => '127',
    'prevPage' => '',
    'nextPage' => '',
    'pageCount' => '1',
    'order' => array(
        'Gasto' => array(
            'fecha' => 'desc'
        )
    ),
    'limit' => '10000',
    'paramType' => 'named'
)

on the action.
Before the change, the order field throw a warning about converting array to string.

@lorenzo
Copy link
Member

lorenzo commented Feb 24, 2014

Would it be better if you used the query string instead? It has better support for nested parameters

@markstory
Copy link
Member

The formatting and indentation for this set of changes is all wrong.

@markstory
Copy link
Member

This code will continue to have problems with more deeply nested arrays. It might be better to use Hash::flatten on the data before generating inputs.

@markstory markstory closed this in 0776b87 Feb 25, 2014
@markstory
Copy link
Member

Thanks for submitting a patch, I decided to implement the change differently using Hash::flatten().

@markstory markstory added this to the 2.4.6 milestone Feb 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants