Tag:Encapsulation class

  • Ajax encapsulation class guide

    Time:2021-4-7

    AJAX is very difficult to say, but if you encapsulate it, you will find that it is very easy to use, of course, it is also a simple application, such as the application of message board. First of all, let’s give you a gift, that is, the encapsulated Ajax class and the download addresshttp://xiazai.jb51.net/201412/yuanma/ajax3.0(jb51.net).rarHere to […]

  • IOS afnetworking various function encapsulation class code

    Time:2020-8-2

    This encapsulation class includes get request, post request, upload image, upload multiple images, Download Image, judge whether the network is available or not. #import <Foundation/Foundation.h> @interface HttpUtil : NSObject typedef NS_ENUM(NSInteger, NetworkReachabilityStatus) { NetworkReachabilityStatusUnknown = -1, NetworkReachabilityStatusNotReachable = 0, NetworkReachabilityStatusReachableViaWWAN = 1, NetworkReachabilityStatusReachableViaWiFi = 2, }; //Get request + (void)getWithURLString:(NSString *)URLString parameters:(id)parameters success:(void (^)(id))success failure:(void […]

  • PHP implements auto-scaling uploaded pictures to specified resolutions and maintaining clarity to encapsulate class examples

    Time:2019-8-3

    This paper describes an example of PHP implementation to automatically zoom the uploaded pictures to the specified resolution, and maintain the clarity of the package class. Share for your reference, as follows: class AutoImage{ private $image; public function resize($src, $width, $height){ // SRC is $_FILES [‘upload_image_file’] [‘tmp_name’] // $width and $height are the specified resolutions […]