asked on
array(11) { [0]=> object(stdClass)#625 (2) { ["group"]=> string(13) "payment_types" ["values"]=> string(32) "["Monthly","Bi-weekly","Weekly"]" } [1]=> object(stdClass)#626 (2) { ["group"]=> string(11) "drive_types" ["values"]=> string(77) "["Front Wheel Drive","Rear Wheel Drive","All Wheel Drive","Four Wheel Drive"]" } [2]=> object(stdClass)#627 (2) { ["group"]=> string(10) "warranties" ["values"]=> string(95) "["Remainder of Factory Warranty","Has Extended Warranty","Warranty is Available","No Warranty"]" } [3]=> object(stdClass)#628 (2) { ["group"]=> string(5) "gears" ["values"]=> string(82) "["3 Speed","4 Speed","5 Speed","6 Speed","7 Speed","8 Speed","9 Speed","10 Speed"]" } [4]=> object(stdClass)#629 (2) { ["group"]=> string(10) "fuel_types" ["values"]=> string(168) "{"Gasoline Fuel":"Gas","Diesel Fuel":"Diesel","Hybrid Fuel":"Hybrid","Flex Fuel Capability":"Flex Fuel Capable","Electric Fuel":"Electric","Propane Fuel":"Natural Gas"}" } [5]=> object(stdClass)#630 (2) { ["group"]=> string(18) "transmission_types" ["values"]=> string(40) "["Automatic","Manual","TipTronic","CVT"]" } [6]=> object(stdClass)#631 (2) { ["group"]=> string(6) "extras" ["values"]=> string(78) "["4x4","AWD","Turbo","Convertible","Cabriolet","Quattro","TDI","Supercharged"]" } [7]=> object(stdClass)#632 (2) { ["group"]=> string(9) "condition" ["values"]=> string(35) "["Excellent","Good","Fair","As Is"]" } [8]=> object(stdClass)#633 (2) { ["group"]=> string(10) "truck_cabs" ["values"]=> string(271) "["Regular Cab","Extended Cab","Crew Cab","--- Ford Specific ---","Super Cab","SuperCrew","--- Dodge Specific ---","Quad Cab","Mega Cab","--- Mazda Specific ---","Cab Plus","--- Nissan Specific ---","King Cab","--- Toyota Specific ---","Access Cab","Double Cab","CrewMax"]" } [9]=> object(stdClass)#634 (2) { ["group"]=> string(21) "vehicle_option_groups" ["values"]=> string(81) "["Comfort","Convenience","Entertainment","Safety","Exterior","Truck, Van & Jeep"]" } [10]=> object(stdClass)#635 (2) { ["group"]=> string(10) "passengers" ["values"]=> string(52) "["1","2","3","4","5","6","7","8","9","10","11","12"]" } }
@foreach ($configuration as $passengers)
<option value="{{ $passengers->values }}" > {{ $passengers->values }}</option>
@endforeach
ASKER
<select data-placeholder="Choose cab style..." class="select" name="cab_style" id="cab_style" >
@if(!isset($vehicle->cab_style))
<option></option>
@endif
<?php
foreach ($configuration as $group) {
if($group->group === "truck_cabs"){
$cabs = json_decode(($group->values));
for ($i = 0; $i < count($cabs); ++$i) {
echo "<option value='$cabs[$i]'> $cabs[$i]</option>";
}
}
}
?>
</select>
<select data-placeholder="Choose cab style..." class="select" name="cab_style" id="cab_style" >
@if(!isset($vehicle->cab_style))
<option></option>
@endif
@foreach ($configuration as $group)
@unless($group->group === "truck_cabs")
$cabs = json_decode(($group->values))
@for ($i = 0; $i < count($cabs); ++$i)
<option value='{{ $cabs[$i] }}'> {{ $cabs[$i] }}</option>
@endfor
@endunless
@endforeach
</select>
ASKER
ASKER
ASKER
PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.
TRUSTED BY
ASKER
But after
if ($group->group === "passengers") {
I can't see how to get the second step? I see I'm checking if the group is "passengers'.
Now that it is, how do I refer to it?
Sorry being a newbie is painful :)