Bootstrap when there are multiple rotations on one page, many people encounter situations where only one carousel can be used and the other carousel fails. There is not much information on the Internet. In fact, there will be such a problem, it should be that the ID of the carousel is duplicated, so lead to bootstrap a page multiple carousel.
When I was doing the project, I combined the smarty template, the extensible configuration carousel, and the ability to implement a single page and multiple carousel.
View Layer:
Test data $result = ' {' Service_type ': "Car", "view": {"Picinfo": {"Tag_ Name ":" Picture Information "," data ": {" pic_1 ": {" explain ":" Vehicle 1 ", "Type": "Text", "Options": "", "Value": [". /.. /.. /web/images/id_card_po ",". /.. /.. /web/images/borrower_contract ",". /.. /.. /web/images/car_dashboard "]}," pic_2 ": {" explain ":" Car Vehicle 2 "," type ":" Text "," Options ":" "," Value ": [" .. /.. /.. /web/images/car_dashboard ",". /.. /.. /web/images/reg_car_info "]}}}} '; $pictures = Json_decode ($result, true); becomes an array of $picdata =array (); $layoutpic =[' picinfo ' =>[[' pic_1 ', ' pic_2 ']]; foreach ($layoutpic as $key = = $kuai) {$dAtakuai=array (); $temp = $pictures [' View '] [$key]; foreach ($kuai as $hang) {$datahang =array (); foreach ($hang as $lie) {$a = $temp [' Data ']; $datahang [$a [$lie] [' Explain ']]= $a [$lie] [' value ']; Var_dump ($datahang); Var_dump ($a [$lie] [' value ']); } array_push ($datakuai, $datahang); } $picdata [$temp [' tag_name ']]= $datakuai; } foreach ($picdata as $key = + $value) {foreach ($value as $key 1 + $value 1) {} } $smarty-Assign ("Mypicture1", $value 1);
Tpls templates:
{foreach $mypicture 1 as $a = + $b} <div style= "Float:left; Display:inline "class=" Infoblock mgt ">
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Bootstrap one-page multiple carousel combination Samrty