12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- namespace Manage\Src;
- use Dever;
- use Dever\Template\View;
- use Manage\Src\Lib\Visual;
- class Template
- {
- /**
- * project
- *
- * @var string
- */
- private $project;
- /**
- * dir
- *
- * @var string
- */
- protected $type;
-
- /**
- * config
- *
- * @var array
- */
- protected $config;
- /**
- * __construct
- *
- * @return mixed
- */
- public function __construct()
- {
- $this->project = Dever::input('key');
- $this->type = Dever::input('type', 'config');
-
- $config = Dever::load('manage/project.get');
- if(isset($config[$this->project]))
- {
- $this->config = $config[$this->project];
- }
- }
-
- /**
- * index
- *
- * @return mixed
- */
- public function index()
- {
- # 读取当前的service
- $view = View::getInstance('home', $this->config['path'], $this->project);
- $content = $view->runing();
-
- $config = $view->result();
-
- if(strpos($content, '</body>') >= 0)
- {
- $content = str_replace('</body>', Visual::tool() . '</body>', $content);
- }
- else
- {
- $content = $content . Visual::tool();
- }
-
- return $content;
- }
- }
|