
2.定义扩展类的内容
<?php
namespace org;
/**
*
*/
class Auth
{
public function __construct()
{
# code...
}
public function xx() {
echo 'xxxxxxxxxxxxxx';
}
}
|
<?php
namespace app\index\controller;
use think\Controller;
use org\Auth; //引入扩展类
class Index extends Controller
{
public function index()
{
$a = new Auth();
$a->xx();
}
}
|
xxxxxxxxxxxxxx