當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ImageManager::isCorrectImageFileExt方法代碼示例

本文整理匯總了PHP中ImageManager::isCorrectImageFileExt方法的典型用法代碼示例。如果您正苦於以下問題:PHP ImageManager::isCorrectImageFileExt方法的具體用法?PHP ImageManager::isCorrectImageFileExt怎麽用?PHP ImageManager::isCorrectImageFileExt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ImageManager的用法示例。


在下文中一共展示了ImageManager::isCorrectImageFileExt方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: validateHotelHeaderImage

 public function validateHotelHeaderImage($image)
 {
     if ($image['size'] > 0) {
         if ($image['tmp_name'] != "") {
             if (!ImageManager::isCorrectImageFileExt($image['name'])) {
                 $this->errors[] = Tools::displayError('<strong>' . $_FILES['header_image']['name'] . '</strong> : Image format not recognized, allowed formats are: .gif, .jpg, .png', false);
             }
         }
     } else {
         return true;
     }
 }
開發者ID:Rohit-jn,項目名稱:hotelcommerce,代碼行數:12,代碼來源:AdminHotelConfigurationSettingController.php

示例2: validAddHotelOtherImage

 public function validAddHotelOtherImage($image)
 {
     if (empty($image['name'])) {
         return;
     }
     //if any one is invalid extension redirect
     foreach ($image['name'] as $img_name) {
         if ($img_name != "") {
             if (!ImageManager::isCorrectImageFileExt($img_name)) {
                 return true;
             }
         }
     }
 }
開發者ID:Rohit-jn,項目名稱:hotelcommerce,代碼行數:14,代碼來源:HotelImage.php

示例3: validateTestimonialsImages

 public function validateTestimonialsImages($image)
 {
     if (empty($image['name'])) {
         return;
     }
     //if any one is invalid extension redirect
     foreach ($image['name'] as $img_name) {
         if ($img_name != "") {
             if (!ImageManager::isCorrectImageFileExt($img_name)) {
                 $this->_postErrors[] = $this->l('Image format not recognized, allowed formats are: .gif, .jpg, .png', false);
             }
         }
     }
 }
開發者ID:Rohit-jn,項目名稱:hotelcommerce,代碼行數:14,代碼來源:wktestimonialblock.php

示例4: validateUpload

 /**
  * Validate image upload (check image type and weight)
  *
  * @param array $file Upload $_FILE value
  * @param integer $max_file_size Maximum upload size
  * @return bool|string Return false if no error encountered
  */
 public static function validateUpload($file, $max_file_size = 0)
 {
     if ((int) $max_file_size > 0 && $file['size'] > (int) $max_file_size) {
         return sprintf(Tools::displayError('Image is too large (%1$d kB). Maximum allowed: %2$d kB'), $file['size'] / 1000, $max_file_size / 1000);
     }
     if (!ImageManager::isRealImage($file['tmp_name'], $file['type']) || !ImageManager::isCorrectImageFileExt($file['name'])) {
         return Tools::displayError('Image format not recognized, allowed formats are: .gif, .jpg, .png');
     }
     if ($file['error']) {
         return sprintf(Tools::displayError('Error while uploading image; please change your server\'s settings. (Error code: %s)'), $file['error']);
     }
     return false;
 }
開發者ID:rrameshsat,項目名稱:Prestashop,代碼行數:20,代碼來源:ImageManager.php

示例5: isCorrectImageExt

 public static function isCorrectImageExt($data)
 {
     return ImageManager::isCorrectImageFileExt($data);
 }
開發者ID:liu33851861,項目名稱:CZD_Yaf_Extension,代碼行數:4,代碼來源:Validate.php


注:本文中的ImageManager::isCorrectImageFileExt方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。