Magento – How to get array value in post

array

We have develop own module for wedding planner. We post multiple products with description on form submit. How to get the "wedding" array in the below values.

Array
(
    [weeding] => Array
        (
            [pCategory] => Array
                (
                    [0] => -1
                    [1] => 45
                )

            [product_cat] => Array
                (
                    [0] => 
                    [1] => 14
                )

            [product_cat_input] => Array
                (
                    [0] => 23423
                    [1] => 
                )

            [product_qty] => Array
                (
                    [0] => 24
                    [1] => 23423
                )

            [product_description] => Array
                (
                    [0] => 234
                    [1] => 234
                )

            [metal_type] => Array
                (
                    [0] => 23
                    [1] => 234
                )

            [stone] => Array
                (
                    [0] => 2423423
                    [1] => 234
                )

            [weight] => Array
                (
                    [0] => 23
                    [1] => 23
                )

            [size] => Array
                (
                    [0] => 23
                    [1] => 23
                )

        )

    [fromprice] => 2
    [toprice] => 23
    [description] => 234
    [name] => vijay Kumar
    [email] => test@test.com
    [address] => Address
    [telephone] => 89
    [country] => IN
    [region_id] => 
    [region] => tamilnadu
    [city] => chennai
    [postcode] => 641029
)

We tried the below line. but this get all the value of post.

$post = $this->getRequest()->getParams('wedding');

Please advice for this.

Best Answer

It should be: $post = $this->getRequest()->getPost('wedding');

If you use getParams() it returns the entire $_POST

Checkout class: Zend_Controller_Request_Http to see all the different methods available to access $_Request, $_Get and $_Post params.

Related Topic