#### Controller
~~~
$controller = new think\Controller();
// 前置操作
$controller->beforeAction($method, $options = []);
// 加载模板输出
$controller->fetch($template = '', $vars = [], $replace = [], $config = []);
// 渲染内容输出
$controller->display($content = '', $vars = [], $replace = [], $config = []);
// 模板变量赋值
$controller->assign($name, $value = '');
// 初始化模板引擎
$controller->engine($engine);
// 设置验证失败后是否抛出异常
$controller->validateFailException($fail = true);
// 验证数据
$controller->validate($data, $validate, $message = [], $batch = false, $callback = null);复制代码
~~~