mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
61 lines
1.5 KiB
PHP
61 lines
1.5 KiB
PHP
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
|
// +----------------------------------------------------------------------
|
|
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
|
|
// +----------------------------------------------------------------------
|
|
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
|
// +----------------------------------------------------------------------
|
|
// | Author: liu21st <liu21st@gmail.com>
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace think\route;
|
|
|
|
use think\Container;
|
|
|
|
abstract class Dispatch
|
|
{
|
|
// 应用实例
|
|
protected $app;
|
|
// 调度信息
|
|
protected $dispatch;
|
|
// 调度参数
|
|
protected $param;
|
|
// 状态码
|
|
protected $code;
|
|
// 是否进行大小写转换
|
|
protected $convert;
|
|
|
|
public function __construct($dispatch, $param = [], $code = null)
|
|
{
|
|
$this->app = Container::get('app');
|
|
$this->dispatch = $dispatch;
|
|
$this->param = $param;
|
|
$this->code = $code;
|
|
$this->init();
|
|
}
|
|
|
|
protected function init()
|
|
{}
|
|
|
|
public function convert($convert)
|
|
{
|
|
$this->convert = $convert;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getDispatch()
|
|
{
|
|
return $this->dispatch;
|
|
}
|
|
|
|
public function getParam()
|
|
{
|
|
return $this->param;
|
|
}
|
|
|
|
abstract public function run();
|
|
|
|
}
|