當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。