当前位置: 首页>>代码示例>>PHP>>正文


PHP TPL::switchHTML方法代码示例

本文整理汇总了PHP中TPL::switchHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP TPL::switchHTML方法的具体用法?PHP TPL::switchHTML怎么用?PHP TPL::switchHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TPL的用法示例。


在下文中一共展示了TPL::switchHTML方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: tpExe

 /**
  * Will execute the passed .tp FilePath, and extract the variables as references (or overwrites). Assigning the variables is
  * not enough. You need to make a CALL to TPL::tpExe ($tpF) to execute the specified $tpF file;
  *
  * @param string $tpFileName The path to the .tp file to be executed
  * @param boolean $tpAsAJAXResponse Set to TRUE when echo'ing the .tp as an AJAX response
  * @return boolean Will return true if the file has been executed properly
  * @author Catalin Z. Alexandru <catalin.zamfir@raphpframework.ro>
  * @copyright Under the terms of the GNU General Public License v3
  * @version $Id: 10_TPL.php 315 2009-10-11 07:11:31Z catalin.zamfir $
  * @since Version 1.0
  * @access public
  * @static
  * @final
  */
 public static final function tpExe(FilePath $tpFileName, B $tpAsAJAXResponse = NULL)
 {
     // Set some requirements ...
     if ($tpAsAJAXResponse == NULL) {
         $tpAsAJAXResponse = new B(FALSE);
     }
     // Make sure we're actually there ...
     if ($tpFileName->checkPathExists()) {
         self::$objFilePathArray[$tpFileName]['dummy_' . $_SERVER['REQUEST_TIME']] = new S('do_not_cache');
         if (extract(self::$objFilePathArray[$tpFileName]->toArray(), EXTR_REFS)) {
             // If it's an AJAX request for HTML, CLEAN it;
             if ($tpAsAJAXResponse->toBoolean() == TRUE) {
                 TPL::discardOutputStream(new B(TRUE));
                 TPL::switchHTML();
             }
             // Require the template file ...
             require $tpFileName->toString();
             // Unset all predefined variables, for a memory clean-up;
             unset(self::$objFilePathArray[$tpFileName]);
             // Do me a favor and STOP right here ...
             if ($tpAsAJAXResponse->toBoolean() == TRUE) {
                 // DIE;
                 TPL::disableFurtherOutput();
             }
             // Return the status;
             return new B(TRUE);
         } else {
             self::renderScreenOfDeath(new S(__CLASS__), new S(CANNOT_EXTRACT_VARS), new S(CANNOT_EXTRACT_VARS_FIX));
         }
     } else {
         self::renderScreenOfDeath(new S(__CLASS__), new S(FILE_DOESNT_EXIST), new S(FILE_DOESNT_EXIST_FIX));
     }
 }
开发者ID:ajbm6,项目名称:raphpframework,代码行数:48,代码来源:10_TPL.php


注:本文中的TPL::switchHTML方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。