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


PHP Content::addHtml方法代码示例

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


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

示例1: Content

<?php

require_once "ClassLoader.php";
$meta_title = "Not Found | 404";
$meta_description = "This page was moved or no longer exists.";
$content = new Content();
$content->addHtml("<h1>Not Found</h1>");
$content->addText("Sorry, the page you requested has moved or no longer exists.");
include "template.inc";
开发者ID:benjaminhough,项目名称:blueprints-web-app,代码行数:9,代码来源:404.php

示例2: Content

<?php

require_once "ClassLoader.php";
echo "<h1>Testing Content.php and Element.php</h1>";
echo "Adding content to sections...<br/><br/>";
// No pre-defined sections
$content = new Content();
$content->add("<h1>Hello World</h1>");
$content->addText("How are you?", 0);
$content->addFile("include-me.inc", "main");
// add index based section
$content->addHtml("<div class='aside'>#1 in the tri-county</div>", "alt");
$content->addHtml("<div class='aside'>Father's Day Sale this weekend</div>", 1);
echo "<h2>Debug String</h2>";
echo "<pre>";
echo $content->debugStr();
echo "</pre>";
echo "<br/><br/>";
// retrieve all
echo "All content...<br/>";
$elements = $content->elements();
foreach ($elements as $e) {
    echo "[" . $e->contentType() . "]" . $e->data() . "<br/>";
}
// retrieve first section
echo "<br/><hr/><br/>First section content...<br/>";
$elements = $content->elements(0);
foreach ($elements as $e) {
    echo "[" . $e->contentType() . "]" . $e->data() . "<br/>";
}
// retrieve second section
开发者ID:benjaminhough,项目名称:blueprints-web-kit,代码行数:31,代码来源:content.php

示例3: array

<?php

require_once "ClassLoader.php";
Log::notice("START: /blueprints/entity.php");
Login::requireLogin("blueprints", "/blueprints/login.php");
$meta_title = "Blueprints";
$meta_description = "Blueprints";
$meta_keywords = "blueprints";
$nav = array();
$content = new Content();
$blueprintSignature = $_REQUEST["blueprint"];
if (empty($blueprintSignature)) {
    $nav[] = "home";
    $content->addHtml("<h1>Blueprints</h1>");
    $content->addFile("index.inc");
} else {
    $action = $_REQUEST["action"];
    if (empty($action)) {
        $action = "add";
    }
    try {
        switch ($action) {
            case "add":
                $content->addHtml("<h1>New {$blueprintSignature}</h1>");
                $js = "\n\t\t\t\t<!-- BEGIN: Javascript -->\n\t\t\t\t<script>\n\t\t\t\t\t\$().ready(function() {\n\t\t\t\t\t\t\$.fn.conduit.debug = true;\n\t\t\t\t\t\t\$('.bp-draft-rendering').conduit({\n\t\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t\tclear: {\n\t\t\t\t\t\t\t\t\ttext: true,\n\t\t\t\t\t\t\t\t\tlabel: 'Clear',\n\t\t\t\t\t\t\t\t\ticon: 'ui-icon-cancel',\n\t\t\t\t\t\t\t\t\tclick: function(event) {\n\t\t\t\t\t\t\t\t\t\tvar \$rendering = event.data.\$rendering;\n\t\t\t\t\t\t\t\t\t\t\$rendering.conduit('clear');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tsave: {\n\t\t\t\t\t\t\t\t\ttext: true,\n\t\t\t\t\t\t\t\t\tlabel: 'Save',\n\t\t\t\t\t\t\t\t\ticon: 'ui-icon-disk',\n\t\t\t\t\t\t\t\t\tclick: function(event) {\n\t\t\t\t\t\t\t\t\t\tvar \$rendering = event.data.\$rendering;\n\t\t\t\t\t\t\t\t\t\t\$rendering.conduit('save');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t\t<!-- END: Javascript -->\n\t\t\t\t";
                $content->addHtml($js);
                try {
                    $html = DraftingDesk::renderForm("FormDrafter", $blueprintSignature);
                    $content->addHtml("{$html}");
                } catch (Exception $e) {
                    $html = "<div class='.error'>Caught Exception: " . $e->getMessage() . "</div>";
开发者ID:benjaminhough,项目名称:blueprints-web-kit,代码行数:31,代码来源:entity.php

示例4: array

<?php

require_once "ClassLoader.php";
Log::debug("START: /blueprints/index.php");
Login::requireLogin("blueprints", "/blueprints/login.php");
$meta_title = "Blueprints";
$meta_description = "Blueprints";
$meta_keywords = "blueprints";
$nav = array("home");
$content = new Content();
$content->addHtml("<h1>Blueprints</h1>");
$content->addFile("index.inc");
$template = "blue";
include "template.inc";
Log::debug("END: /blueprints/index.php" . "\n");
开发者ID:benjaminhough,项目名称:blueprints-web-kit,代码行数:15,代码来源:index.php

示例5: EntityDAO

        if (Login::loggedIn($domain)) {
            // Retrieve 'login' from users Login Session
            $login = Login::who($domain);
            // Retrieve member data
            $memberBP = BlueprintReader::read("Member.entity.xml");
            $memberDAO = new EntityDAO($memberBP);
            $matches = $memberDAO->findWhere("login", $login);
            if (count($matches) > 0) {
                $member = $matches[0];
                // Add data to the users session
                Session::user("member_id", $member->getId());
                // Required by Guardian
                // Forward user
                Log::debug("* REDIRECTING TO: {$destination}\n");
                header("location: {$destination}");
                exit;
            } else {
                // Should never happen, since users password was just checked
                Log::error("* Member with login '{$login}' was not found.");
                $content->addHtml("<strong>Login Error</strong><br/>");
                $content->addHtml("Message: Member with login '{$login}' was not found.");
                $content->addFile("login.frm");
            }
        } else {
            Log::warning("* Can't 'init' invalid login session.");
        }
    }
}
$content->addFile("login.frm");
include "template.inc";
Log::debug("END: /etc/auth/login.php" . "\n");
开发者ID:benjaminhough,项目名称:blueprints-web-app,代码行数:31,代码来源:login.php


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