标签:containe public container 访问 namespace func extend UNC function
namespace app\index\controller;
use think\Controller;
class Index extends Controller
{
public function _initialize()
{
echo ‘init<br/>‘;
}
public function hello()
{
return ‘hello‘;
}
public function data()
{
return ‘data‘;
}
}
如果访问
http://localhost/index.php/index/Index/hello
会输出
init
hello
如果访问
http://localhost/index.php/index/Index/data
会输出
init
data
标签:containe public container 访问 namespace func extend UNC function
原文地址:https://www.cnblogs.com/mmore123/p/12848306.html