mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 20:52:48 +08:00
添加内容解析类
This commit is contained in:
28
Think/Parser.php
Normal file
28
Think/Parser.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | TOPThink [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011 http://topthink.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
// $Id$
|
||||
|
||||
namespace Think;
|
||||
// 内容解析类
|
||||
class Parser {
|
||||
protected $handler = null;
|
||||
public function __construct($content,$type){
|
||||
$class = '\Think\Parser\Driver\\'.ucwords($type);
|
||||
$parse = new $class();
|
||||
return $parse->parse($content);
|
||||
}
|
||||
|
||||
// 解析内容
|
||||
static public function parse($content,$type){
|
||||
return new static($content,$type);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user