CrossPHP
  • Namespace
  • Class
  • Download

Namespaces

  • Cross
    • Auth
    • Cache
      • Driver
      • Request
    • Core
    • DB
      • Connecter
      • Drivers
      • SQLAssembler
    • Exception
    • Http
    • I
    • Lib
      • Document
    • Module
    • MVC
    • Runtime
  • None

Classes

  • Cross\Auth\CookieAuth
  • Cross\Auth\SessionAuth
  • Cross\Cache\Driver\FileCacheDriver
  • Cross\Cache\Driver\MemcacheDriver
  • Cross\Cache\Driver\RedisDriver
  • Cross\Cache\Request\FileCache
  • Cross\Cache\Request\Memcache
  • Cross\Cache\Request\RedisCache
  • Cross\Cache\RequestCache
  • Cross\Core\Annotate
  • Cross\Core\Application
  • Cross\Core\ArrayMap
  • Cross\Core\Config
  • Cross\Core\CrossArray
  • Cross\Core\Delegate
  • Cross\Core\FrameBase
  • Cross\Core\Helper
  • Cross\Core\HttpAuth
  • Cross\Core\Loader
  • Cross\Core\Rest
  • Cross\Core\Router
  • Cross\DB\Connecter\BaseConnecter
  • Cross\DB\Connecter\MySQLConnecter
  • Cross\DB\Connecter\PgSQLConnecter
  • Cross\DB\Connecter\SQLiteConnecter
  • Cross\DB\DBFactory
  • Cross\DB\Drivers\CouchDriver
  • Cross\DB\Drivers\MongoDriver
  • Cross\DB\Drivers\PDOSqlDriver
  • Cross\DB\SQLAssembler\MySQLAssembler
  • Cross\DB\SQLAssembler\PgSQLAssembler
  • Cross\DB\SQLAssembler\SQLAssembler
  • Cross\DB\SQLAssembler\SQLiteAssembler
  • Cross\Http\Request
  • Cross\Http\Response
  • Cross\Lib\Array2XML
  • Cross\Lib\Document\CallTree
  • Cross\Lib\Document\CallTreeToHTML
  • Cross\Lib\Document\HTML
  • Cross\Lib\StringToPHPStream
  • Cross\Module\SQLModule
  • Cross\MVC\Controller
  • Cross\MVC\Module
  • Cross\MVC\View
  • Cross\Runtime\ClosureContainer

Interfaces

  • Cross\I\CacheInterface
  • Cross\I\HttpAuthInterface
  • Cross\I\PDOConnecter
  • Cross\I\RequestCacheInterface
  • Cross\I\RouterInterface
  • Cross\I\SqlInterface

Exceptions

  • Cross\Exception\CacheException
  • Cross\Exception\CoreException
  • Cross\Exception\CrossException
  • Cross\Exception\FrontException

Functions

  • ascLogo
  • line
  • tBody
  • th
  • tHead
 1 <?php
 2 /**
 3  * Cross - a micro PHP 5 framework
 4  *
 5  * @link        http://www.crossphp.com
 6  * @license     MIT License
 7  */
 8 
 9 namespace Cross\Lib\Document;
10 
11 use DOMDocument;
12 
13 /**
14  * 保存调用关系
15  *
16  * @author wonli <wonli@live.com>
17  * Class NodeTree
18  * @package Cross\Lib\Document
19  */
20 class CallTree
21 {
22 
23     private $node = array();
24 
25     private function __construct()
26     {
27 
28     }
29 
30     public static function getInstance()
31     {
32         return new CallTree();
33     }
34 
35     /**
36      * 保存调用关系
37      *
38      * @param string $node_name
39      * @param mixed $node_arguments
40      */
41     function saveNode($node_name, $node_arguments)
42     {
43         $this->node = array($node_name => $node_arguments);
44     }
45 
46     /**
47      * 输出HTML标签
48      * @param bool $html_decode
49      */
50     function html($html_decode = true)
51     {
52         echo $this->nodeToHTML($html_decode);
53     }
54 
55     /**
56      * 输出DOM
57      *
58      * @return DOMDocument
59      */
60     function dom()
61     {
62         return CallTreeToHTML::getInstance()->getDom($this->getNode());
63     }
64 
65     /**
66      * 获取当前node内容
67      *
68      * @return array
69      */
70     function getNode()
71     {
72         return $this->node;
73     }
74 
75     /**
76      * @see nodeToHTML
77      *
78      * @return string
79      */
80     function __toString()
81     {
82         return $this->nodeToHTML();
83     }
84 
85     /**
86      * 把node转换为html
87      *
88      * @param bool $html_decode
89      * @return string
90      */
91     private function nodeToHTML($html_decode = true)
92     {
93         return CallTreeToHTML::getInstance()->getHTML($this->getNode(), $html_decode);
94     }
95 }
96 
CrossPHP API documentation generated by ApiGen