PHP warning

Invalid argument supplied for foreach()

/home/suryasukses/public_html/protected/views/home/product_landing.php(46)

34         
35       </div>
36       </div>
37       <div class="col-md-45">
38         <h3><?php echo ucwords($n_model['name_category']) ?></h3>
39         <div class="row feature-data">
40           <div class="col-md-60">
41             
42             <!-- <img class="img img-fluid w-100" src="<?php echo $this->assetBaseurl; ?>product1.jpg" alt="<?php echo $_GET['slug'] ?>">  -->
43             <div class="featured_car_detail">
44                 <div id="carouselEx_gallery" class="carousel slide" data-ride="carousel">
45                   <ol class="carousel-indicators">
46                     <?php foreach ($n_model['picture'] as $key => $value): ?>
47                     <li data-target="#carouselEx_gallery" data-slide-to="<?php echo $key ?>" <?php if ($key == 0): ?>class="active"<?php endif ?>></li>
48                     <?php endforeach ?>
49                   </ol>
50                   <div class="carousel-inner">
51                     <?php foreach ($n_model['picture'] as $key => $value): ?>
52                     <div class="carousel-item <?php if ($key == 0): ?>active<?php endif ?>">
53                       <img class="img img-fluid w-100" src="<?php echo $this->assetBaseurl.'../../images/products/'; ?><?php echo $value ?>" alt="<?php echo $_GET['slug'] ?>"> 
54                     </div>
55                     <?php endforeach; ?>
56                   </div>
57                 </div>
58             </div>

Stack Trace

#4
+
 /home/suryasukses/public_html/protected/controllers/HomeController.php(899): CController->render("product_landing", array("product_resource" => array(array("name_category" => "packaging", "picture" => array("cover-bottle.jpg", "cover-closures.jpg", "cover-drinking-cups.jpg", "cover-containers.jpg", ...), "desc" => "", "lists" => array(array("names" => "preform", "picture" => array("preform001.jpg", "preform002.jpg"), "info" => "<p>Our PET preform infrastructure and machineries are one of the..."), array("names" => "bottles", "picture" => array("bottle001.jpg", "bottle002.jpg"), "info" => "<p>Surya Sukses Group offers high quality bottles made from Inje..."), array("names" => "closures", "picture" => array("closures001.jpg"), "info" => "<p>Surya Sukses Group produce approximately 25% of all bottle cl..."), array("names" => "drinking cups", "picture" => array("drinking-cups001.jpg", "drinking-cups002.jpg"), "info" => "<p>At Surya Sukses Group, we produce any kind and variety of cup..."), ...)), array("name_category" => "specialty nonwoven", "picture" => array("cover-specialty.jpg"), "desc" => "<p>Our nonwoven fabric solutions are produced on unique and worl...", "lists" => array(array("names" => "spunbond polypropylene", "picture" => array("spubond-polypropylene.jpg"), "info" => "<p>Surya Sukses Group is catering the needs of economic yet dura..."), array("names" => "meltblown", "picture" => array("meltblown-001.jpg", "meltblown-002.jpg"), "info" => "<p>Our meltblown nonwoven products are formed from micro fibers ..."))), array("name_category" => "Housewares", "picture" => array("cover-bathroom.jpg", "cover-cleaningware.jpg", "cover-garden.jpg", "cover-kitchenware.jpg", ...), "desc" => "<p>Surya Sukses Group started its industrial group from a plasti...", "lists" => array(array("names" => "Storage", "picture" => array("3.jpg"), "info" => "<p>We present a variety of plastic products for smart and ergono..."), array("names" => "Sealware", "picture" => array("sealware001.jpg", "sealware002.jpg"), "info" => "<p>With Surya Sukses Group`s sophisticated and modern production..."), array("names" => "Kitchen", "picture" => array("10.jpg"), "info" => "<p>A variety of kitchen utensils and tableware are presented by ..."), array("names" => "Containers", "picture" => array("containers001.jpg", "containers002.jpg"), "info" => "<p>We manufacture varieties of plastic containers for the usage ..."), ...)), array("name_category" => "roofing", "picture" => array("cover-roofing-suryasukses.jpg"), "desc" => "", "lists" => array(array("names" => "UPVC", "picture" => array("twin-wall-001.jpg", "twin-wall-002.jpg", "twin-wall-003.jpg"), "info" => "<p>Amari UPVC roofing system is offered as part of the company`s...")))), "n_model" => null))
894 
895         $n_model = $data[$s_id];
896 
897         $this->render('product_landing', array(
898             'product_resource'=>$data,
899             'n_model'=>$n_model,
900         ));
901     }
902 
903     public function actionProduct_range()
904     {
#12
+
 /home/suryasukses/public_html/index.php(36): CApplication->run()
31 // specify how many levels of call stack should be shown in each log message
32 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
33 error_reporting(E_ALL ^ E_NOTICE);
34 date_default_timezone_set('Asia/Jakarta');
35 require_once($yii);
36 Yii::createWebApplication($config)->run();
37 
38 $end_timeeeee = microtime(TRUE);
39 
40 // echo $end_timeeeee - $start_timeeeee;
41 // echo "<br>";
2021-01-26 18:04:30 Apache Yii Framework/1.1.12