<?php
1. Loading System class methods
Load_sys_class ($classname, $path = "", $initialize = 1)
The file path where the system class file is located: under the/phpcms/libs/classes/folder
Parameter description:
@param string $classname class name
@param string $path Extension address
@param Intger $initialize is initialized
Example: To call the System form class to generate the CAPTCHA function: Checkcode (), see the following example
Pc_base::load_sys_class (' form ', ', 0); Load System Form Class
echo form::checkcode (' code_img ', ' 4 ', ' 14 ', 84, 24); Calling a function within a system form
The results show that the resulting verification code, such as
One of the PHPCMS development Notes <wbr><wbr> Load system class and load application class The difference between the detailed
2. Load the Application class method
Load_app_class ($classname, $m = "", $initialize = 1)
File path where the application class file resides: Under the/phpcms/modules/member/classes/folder (for Member Application module Class description path)
Parameter description:
@param string $classname class name
@param string $m Module
@param Intger $initialize is initialized
Example: Example of a client class that introduces a member application module
Pc_base::load_app_class (' client ', ' member '); Load Member Application Module client class
$phpsso _api_url = pc_base::load_config (' System ', ' Phpsso_api_url ');
$phpsso _auth_key = pc_base::load_config (' System ', ' Phpsso_auth_key ');
$client = new Client ($phpsso _api_url, $phpsso _auth_key); Creating objects
$username = ' phpcms ';
$pasword = ' 123456 ';
$client->ps_member_login ($username, $password); Calling the login function
Note: If the application class is loaded across modules, do not forget the parameter $m, otherwise the application class will not be loaded.
?>
PHPCMS load System class and load application class The difference between the detailed