本文整理汇总了PHP中TemplateEngine::templateFromFile方法的典型用法代码示例。如果您正苦于以下问题:PHP TemplateEngine::templateFromFile方法的具体用法?PHP TemplateEngine::templateFromFile怎么用?PHP TemplateEngine::templateFromFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TemplateEngine
的用法示例。
在下文中一共展示了TemplateEngine::templateFromFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: htmlentities
<?php
/*------------------------------------------------------------------------------
File: www/issues_edit.php
Project: cs2760 - Assignment #8
Version: 0.1.0
By: Lauren Stratton, Simon McIlhargey, Tim Oram
------------------------------------------------------------------------------*/
require 'init.php';
$tpl = TemplateEngine::templateFromFile('content/issues_edit');
if (isset($_GET['id']) && (int) $_GET['id'] > 0) {
$id = (int) $_GET['id'];
} else {
if (isset($_POST['id'], $_POST['name'], $_POST['details'])) {
$id = (int) $_POST['id'];
$name = htmlentities($_POST['name'], ENT_QUOTES);
$details = nl2br($_POST['details']);
$author = 2;
if (isset($_POST['type']) && (int) $_POST['type'] >= 0) {
$type = (int) $_POST['type'];
} else {
$type = 1;
}
if (isset($_POST['target']) && (int) $_POST['target'] >= 0) {
$target = (int) $_POST['target'];
} else {
$target = 1;
}
if (isset($_POST['assign']) && (int) $_POST['assign'] >= 0) {
$assign = (int) $_POST['assign'];
} else {
示例2:
<?php
/*------------------------------------------------------------------------------
File: www/index.php
Project: cs2760 - Assignment #8
Version: 0.1.0
By: Lauren Stratton, Simon McIlhargey, Tim Oram
------------------------------------------------------------------------------*/
require 'init.php';
$tpl = TemplateEngine::templateFromFile('content/projects');
TemplateEngine::output($tpl);