Common functions and common code are summarized as follows
1<?PHP2 //converts the encoding of a string or array3Str_charset ($in _charset,$out _charset,$str _or_arr) 4 5 //get Menu6Menu$parentid,$code= ' ')7 8 //determine if the current browser is IE9 Is_ie ()Ten One //Check the legality of the date AIs_date ($ymd,$sep= '-') - - //Check the legality of your mailbox theIs_email ($email) - - //Intercept String -Str_cut ($string,$length,$dot= ' ... ') + - //Read Cache +Cache_read ($file,$path= ",$iscachevar= 0) A at //Write Cache -Cache_write ($file,$array,$path= ' ') - - //Delete a cache file -Cache_delete ($file,$path= ' ') - in //Convert a string to an array -String2array ($data) to + //access to regional -SubArea$parentid= 0) the * //get the classification of modules $Subtype ($module= ' Phpcms ')Panax Notoginseng - //generate thumbnail images theThumb$imgurl,$width= 100,$height= 100,$autocut= 1) + A //Get all sub-column IDs for $catid theGet_sql_catid ($catid) + - //create an IN clause $Get_sql_in ($string,$s= ' ') $ - //Paging Functions -Pages ($total,$page= 1,$perpage= 20,$urlrule= ",$array=Array(),$catid= 0) the - //contains a class file (like: include_once) and returns an objectWuyiLoad$file,$module= ' Phpcms ',$dir= ",$isinit= 1) the - //returns the name of the $areaid corresponding region WuAreaName ($areaid) - About //Convert an element in an array into a variable $ Extract($data); - - //Definition of Constants -Phpcms/base.php file A + //calling the module's database model the $this->db = Pc_base::load_model (' Test_model ');//load the model class file from the "phpcms/model/" directory - //Where the methods supported in $THIS->DB are referenced in phpcms/libs/classes/model.class.php $ the //Load System class the $http= Pc_base::load_sys_class (' http ');//instantiating an HTTP class thePc_base::load_sys_class (' Format ', ', 0);//calling the form class without instantiating the operation 3. Loading System Letters the - //Load system function library inPc_base::load_sys_func (' Mail '); Calling the Mail function package the the //Load Module class About $test= Pc_base::load_app_class (' classname ', ' test ');//instantiate the ClassName class under test module the the //Load module function library thePc_base::load_app_func ('Global‘,' test '); Calling the test module's global function package + //Features: -Load_sys_class ()://Loading system class library files from "phpcms/libs/classes/" theLoad_sys_func ()://Loading system function library files from "phpcms/libs/functions/"BayiLoad_app_class ()://Load Module class library file from "phpcms/modules/module name/classes/" theLoad_app_func ()://Load module function library file from "phpcms/modules/module name/functions/" theLoad_config ();//loading configuration files or configuration information - //Loading the front-page template - includeTemplate (' Test ', ' mytest ', ' Default '); the the //loading the background template the include $this->ADMIN_TPL (' Mytest_admin_list '); the - //Permission Control the The //background control controller needs to load the Admin class under the admin module and inherit the class the defined(' In_phpcms ') orExit(' No permission resources. ')); thePc_base::load_app_class (' admin ', ' admin ', 0);//load Admin class Library under admin module94 classMytest_adminextendsAdmin the { the //This controller needs to be logged in to the background to access the } 98 //character encoding conversion functions Aboutphpcms/libs/functions/Iconv. Func.PHP - 101 //Outgoing mail function102phpcms/libs/functions/Mail. Func.PHP103 104 //extension Functions thePhpcms/libs/functions/extention.func.PHP106?>
This document will be continuously updated ...
Good good Study, day.
Sequential Selection Cycle Summary
Phpcms V9 common functions and code collation