[Wact-cvs] wact/framework/template/tags/dev tree.tag.php,NONE,1.1
Status: Pre-Alpha
Brought to you by:
jeffmoore
From: <ha...@us...> - 2004-02-29 22:23:10
|
Update of /cvsroot/wact/wact/framework/template/tags/dev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3776 Added Files: tree.tag.php Log Message: Tag for calling dump_component_tree from within the template --- NEW FILE: tree.tag.php --- <?php //-------------------------------------------------------------------------------- // Copyright 2003 Procata, Inc. // Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) //-------------------------------------------------------------------------------- /** * @package WACT_TAG * @version $Id: tree.tag.php,v 1.1 2004/02/29 22:04:45 harryf Exp $ */ //-------------------------------------------------------------------------------- /** * Register the tag */ registerTag(new DevTreeTagInfo()); /** * @see http://wact.sourceforge.net/index.php/TagInfoClasses * @access protected * @package WACT_TAG */ class DevTreeTagInfo { var $Tag = 'dev:TREE'; var $EndTag = ENDTAG_REQUIRED; var $TagClass = 'DevTreeTag'; } /** * Dumps the component tree into the compiled template * @see http://wact.sourceforge.net/index.php/DevTreeTag * @access protected * @package WACT_TAG */ class DevTreeTag extends CompilerDirectiveTag { /** * @return int PARSER_REQUIRE_PARSING * @access protected */ function preParse() { return PARSER_REQUIRE_PARSING; } /** * @param CodeWriter * @return void * @access protected */ function preGenerate(&$code) { parent::preGenerate($code); $code->writeHTML('<br /><hr /><h3>Begin Tree Dump</h3>'); } /** * @param CodeWriter * @return void * @access protected */ function postGenerate(&$code) { ob_start(); dump_component_tree($this); $tree = ob_get_contents(); ob_end_clean(); $code->writeHTML($tree.'<br /><h3>End Tree Dump</h3><hr />'); parent::postGenerate($code); } } ?> |