FAQ
Hi I have received the following array as a result of var_dump($x).

array(2) {
[0]=> array(1)
{ ["Driver"]=> array(13)
{ ["driver_id"]=> string(1) "4" ["fname"]=> string(13)
"jack williams"
["gender"]=> string(4) "male" ["email"]=> string(12)
"jack@msn.com"
["state"]=> string(7) "florida" ["city"]=> string(17)
"Altamonte Springs"
["zipcode"]=> string(6) "451456" ["address"]=>
string(14) "st xena street"
["phone_no"]=> string(9) "984568745" ["car_type"]=>
string(6) "Luxury"
["hourly_rate"]=> string(2) "45" ["occasion"]=>
string(8) "marriage"
["driver_image"]=> string(0) ""
}
}
[1]=> array(1)
{ ["Driver"]=> array(13)
{ ["driver_id"]=> string(1) "5" ["fname"]=> string(14)
"Peter Gonzalez"
["gender"]=> string(4) "male" ["email"]=> string(15)
"peter@gmail.com"
["state"]=> string(7) "Florida" ["city"]=> string(17)
"Altamonte Springs"
["zipcode"]=> string(6) "451456" ["address"]=>
string(22) "626 Kennedy St Jackson"
["phone_no"]=> string(14) "(941) 866-0530"
["car_type"]=> string(6) "Luxury"
["hourly_rate"]=> string(2) "41" ["occasion"]=>
string(8) "marriage"
["driver_image"]=> string(0) ""
}
}
}

Now I want to pass each record one by one to 'view2.ctp'.
Anybody can explain me?

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Search Discussions

  • Raj Dudi at Jun 26, 2012 at 7:51 pm
    May be you want to use foreach and then set with variable as data[i] so
    that it is available in view seperatly
    On Tue, Jun 26, 2012 at 11:43 AM, Roshan wrote:

    Hi I have received the following array as a result of var_dump($x).

    array(2) {
    [0]=> array(1)
    { ["Driver"]=> array(13)
    { ["driver_id"]=> string(1) "4" ["fname"]=> string(13)
    "jack williams"
    ["gender"]=> string(4) "male" ["email"]=> string(12)
    "jack@msn.com"
    ["state"]=> string(7) "florida" ["city"]=>
    string(17) "Altamonte Springs"
    ["zipcode"]=> string(6) "451456" ["address"]=>
    string(14) "st xena street"
    ["phone_no"]=> string(9) "984568745" ["car_type"]=>
    string(6) "Luxury"
    ["hourly_rate"]=> string(2) "45" ["occasion"]=>
    string(8) "marriage"
    ["driver_image"]=> string(0) ""
    }
    }
    [1]=> array(1)
    { ["Driver"]=> array(13)
    { ["driver_id"]=> string(1) "5" ["fname"]=> string(14)
    "Peter Gonzalez"
    ["gender"]=> string(4) "male" ["email"]=> string(15)
    "peter@gmail.com"
    ["state"]=> string(7) "Florida" ["city"]=>
    string(17) "Altamonte Springs"
    ["zipcode"]=> string(6) "451456" ["address"]=>
    string(22) "626 Kennedy St Jackson"
    ["phone_no"]=> string(14) "(941) 866-0530"
    ["car_type"]=> string(6) "Luxury"
    ["hourly_rate"]=> string(2) "41" ["occasion"]=>
    string(8) "marriage"
    ["driver_image"]=> string(0) ""
    }
    }
    }

    Now I want to pass each record one by one to 'view2.ctp'.
    Anybody can explain me?

    --
    Our newest site for the community: CakePHP Video Tutorials
    http://tv.cakephp.org
    Check out the new CakePHP Questions site http://ask.cakephp.org and help
    others with their CakePHP related questions.


    To unsubscribe from this group, send email to
    cake-php+unsubscribe@googlegroups.com For more options, visit this group
    at http://groups.google.com/group/cake-php
    --
    Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
    Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


    To unsubscribe from this group, send email to
    cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
  • Lowpass at Jun 26, 2012 at 9:38 pm
    If you set separate variables, how will you write the code for the
    view without knowing how many variables have been set? Better to pass
    the entire array to the view and run a foreach() loop in the view.
    On Tue, Jun 26, 2012 at 5:43 AM, Roshan wrote:
    Hi I have received the following array as a result of var_dump($x).

    array(2) {
    [0]=> array(1)
    { ["Driver"]=> array(13)
    { ["driver_id"]=> string(1) "4" ["fname"]=> string(13)
    "jack williams"
    ["gender"]=> string(4) "male" ["email"]=> string(12)
    "jack@msn.com"
    ["state"]=> string(7) "florida" ["city"]=> string(17)
    "Altamonte Springs"
    ["zipcode"]=> string(6) "451456" ["address"]=>
    string(14) "st xena street"
    ["phone_no"]=> string(9) "984568745" ["car_type"]=>
    string(6) "Luxury"
    ["hourly_rate"]=> string(2) "45" ["occasion"]=>
    string(8) "marriage"
    ["driver_image"]=> string(0) ""
    }
    }
    [1]=> array(1)
    { ["Driver"]=> array(13)
    { ["driver_id"]=> string(1) "5" ["fname"]=> string(14)
    "Peter Gonzalez"
    ["gender"]=> string(4) "male" ["email"]=> string(15)
    "peter@gmail.com"
    ["state"]=> string(7) "Florida" ["city"]=> string(17)
    "Altamonte Springs"
    ["zipcode"]=> string(6) "451456" ["address"]=>
    string(22) "626 Kennedy St Jackson"
    ["phone_no"]=> string(14) "(941) 866-0530"
    ["car_type"]=> string(6) "Luxury"
    ["hourly_rate"]=> string(2) "41" ["occasion"]=>
    string(8) "marriage"
    ["driver_image"]=> string(0) ""
    }
    }
    }

    Now I want to pass each record one by one to 'view2.ctp'.
    Anybody can explain me?

    --
    Our newest site for the community: CakePHP Video Tutorials
    http://tv.cakephp.org
    Check out the new CakePHP Questions site http://ask.cakephp.org and help
    others with their CakePHP related questions.


    To unsubscribe from this group, send email to
    cake-php+unsubscribe@googlegroups.com For more options, visit this group at
    http://groups.google.com/group/cake-php
    --
    Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
    Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


    To unsubscribe from this group, send email to
    cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcake-php @
categoriesphp
postedJun 26, '12 at 7:22p
activeJun 26, '12 at 9:38p
posts3
users3
websitecakephp.org
irc#cakephp

3 users in discussion

Raj Dudi: 1 post Lowpass: 1 post Roshan: 1 post

People

Translate

site design / logo © 2022 Grokbase