本文整理汇总了PHP中Renderer::get_instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Renderer::get_instance方法的具体用法?PHP Renderer::get_instance怎么用?PHP Renderer::get_instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Renderer
的用法示例。
在下文中一共展示了Renderer::get_instance方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: while
while ($row = $content_query->fetch_assoc()) {
$content = $row['value'];
}
if (isset($_POST['action']) && $_POST['action'] == 'render') {
/**
* Update the page content.
*/
$sql = "UPDATE temp SET value='{$_POST['content']}' WHERE id=1";
$content = $_POST['content'];
if (!($result = $db->query($sql))) {
die("There was an error running the query [{$db->error}].");
}
/**
* Get an instance of the page renderer;
*/
$renderer = Renderer::get_instance();
/**
* Build the front page
*/
if ($renderer->render_page("/")) {
echo '<div class="alert alert--success">Front page has been successfully built. View at <a href="http://staticcms.dev" target="_blank">StaticCMS</a>.</div>';
} else {
echo '<div class="alert alert--error">Front page could not be built.</div>';
}
/**
* Build a sub directory
*/
if ($renderer->render_page("/about")) {
echo '<div class="alert alert--success">About page has been successfully built. View at <a href="http://staticcms.dev" target="_blank">StaticCMS</a>.</div>';
} else {
echo '<div class="alert alert--error">About page could not be built.</div>';