コード例 #1
0
 public function getImages()
 {
     $root = _PS_ROOT_DIR_ . DS . 'img' . DS . 'as' . DS . $this->sellerinfo->id_sellerinfo;
     $pathImg = SellerInfo::getLogoFolder($this->sellerinfo->id_sellerinfo);
     $images = scandir($root);
     unset($images[0]);
     unset($images[1]);
     $images = array_values($images);
     $images2 = array();
     foreach ($images as $v) {
         // Get key value from image
         $imagesKey = explode("-", $v);
         if (strpos($imagesKey[1], 'jpg') !== false) {
             $key = substr($imagesKey[1], 0, -4);
         } else {
             $key = $imagesKey[1];
         }
         $images2[$key] = $pathImg . $v;
     }
     $this->sellerinfo->images_path = $images2;
 }