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


PHP Page::addContent方法代码示例

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


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

示例1:

$year = CommonTools::GET('year');
// Is the search performed?
if ($searchString != null && $searchString != "") {
    $debugger->debug("Searching signup gadgets using search string {$searchString}", "index.php");
    $signupGadgets->selectSearchSignupGadget($searchString);
} else {
    if ($year != null && $year != "") {
        $signupGadgets->selectSignupGadgetsByYear($year);
    } else {
        $signupGadgets->selectOpenGadgetsOrClosedDuringLastDays(7);
    }
}
// Get all selected gadgets to array
$signupGadgets_array = $signupGadgets->getSignupGadgets();
// Print table headers
$page->addContent("<table id=\"signup-gadgets\">");
$page->addContent("<tr id=\"signup-header-row\">");
$page->addContent("<th id=\"signup-name-header\">Ilmo</th><th>Avautuu</th><th>Sulkeutuu</th><th>Tila</th><th>Muokkaa</th><th>Poista</th><th>Muuta tilaa</th>");
$page->addContent("</tr>");
foreach ($signupGadgets_array as $gadget) {
    $page->addContent("<tr class=\"answer-row\">");
    $page->addContent("<td class=\"signup-name\"><a href=\"showanswers/" . $gadget->getId() . "\">" . $gadget->getTitle() . "</td>");
    $page->addContent("<td class=\"signup-opens\">" . $gadget->getOpeningTime() . "</td>");
    $page->addContent("<td class=\"signup-closes\">" . $gadget->getClosingTime() . "</td>");
    if ($gadget->isOpen()) {
        $page->addContent("<td class=\"open-close-state\"><span class=\"signup-open\">Auki</span></td>");
    } else {
        if ($gadget->willBeOpened()) {
            $page->addContent("<td class=\"open-close-state\"><span class=\"signup-not-yet-open\">Ei vielä avautunut</td>\n");
        } else {
            $page->addContent("<td class=\"open-close-state\"><span class=\"signup-closed\">Sulkeutunut</td>\n");
开发者ID:Alphenus,项目名称:ilmomasiina-php,代码行数:31,代码来源:index.php

示例2: Configurations

require_once "classes/Page.php";
require_once "classes/SignupGadgets.php";
require_once "classes/Debugger.php";
require_once "classes/SignupGadget.php";
/* Implementations of the most critical classes */
$configurations = new Configurations();
$page = new Page();
$debugger = new Debugger();
$database = new Database();
/* The code */
$signupGadgets = new SignupGadgets();
$signupGadgets->selectOpenGadgetsOrClosedDuringLastDays(30);
// Get all selected gadgets to array
$signupGadgets_array = $signupGadgets->getSignupGadgets();
// Print table headers
$page->addContent("<table class=\"signupGadgetsTable\">");
$page->addContent("<tr>");
$page->addContent("<th>Ilmo</th><th>Avautuu</th><th>Sulkeutuu</th><th>Tila</th>");
$page->addContent("</tr>");
foreach ($signupGadgets_array as $gadget) {
    $page->addContent("<tr>");
    $page->addContent("<td><a href=\"queue.php?id=" . $gadget->getId() . "\">" . $gadget->getTitle() . "</td>");
    $page->addContent("<td>" . $gadget->getOpeningTime() . "</td>");
    $page->addContent("<td>" . $gadget->getClosingTime() . "</td>");
    if ($gadget->isOpen()) {
        $page->addContent("<td><span class=\"signUpOpen\">Auki</span></td>");
    } else {
        if ($gadget->willBeOpened()) {
            $page->addContent("<td><span class=\"signUpWillBeOpened\">Ei vielä avautunut</td>\n");
        } else {
            $page->addContent("<td><span class=\"signUpClosed\">Sulkeutunut</td>\n");
开发者ID:Alphenus,项目名称:ilmomasiina-php,代码行数:31,代码来源:index_.php

示例3: Listview

/**
 * Create and config a new listview object and add Items.
 */
$list1 = new Listview();
$list1->splitIcon('search')->splitTheme('c');
$list1->addDivider('Beginner', '2')->inset(true);
$list1->addBasic('Basic Example', 'example-1.php');
$list1->items()->get(1)->add('<a href="example-1.php" rel="external" target="_blank"></a>');
$list1->addBasic('Adding Pages', 'example-2.php');
$list1->items()->get(2)->add('<a href="example-2.php" rel="external" target="_blank"></a>');
$list1->addDivider('Intermediate', '3');
$list1->addBasic('Adding Objects', 'example-3.php');
$list1->items()->get(4)->add('<a href="example-3.php.txt" rel="external" target="_blank"></a>');
$list1->addBasic('Adding Form Elements', 'example-4.php');
$list1->items()->get(5)->add('<a href="example-4.php.txt" rel="external" target="_blank"></a>');
$list1->addBasic('Adding Listview', 'example-5.php');
$list1->items()->get(6)->add('<a href="example-5.php.txt" rel="external" target="_blank"></a>');
$list1->addDivider('Advanced', '3');
$list1->add('<li><a href="custom-css.php" rel="external">Custom CSS</a><a href="custom-css.php.txt" rel="external" target="_blank"></a></li>');
$list1->add('<li><a href="custom-js.php" rel="external">Custom JavaScript</a><a href="custom-js.php.txt" rel="external" target="_blank"></a></li>');
$list1->addBasic('Load Simple XML', 'simple-xml.php');
$list1->items()->get(10)->add('<a href="simple-xml.php.txt" rel="external" target="_blank"></a>');
$p->addContent($list1);
/**
 * Add the page to iMobile object.
 */
$j->addPage($p);
/**
 * Generate the HTML code.
 */
echo $j;
开发者ID:TechnoSoluciones,项目名称:B2C,代码行数:31,代码来源:index.php

示例4: Database

$database = new Database();
/* The code */
// Chech the id
$signupid = $request->getSignupId();
$sort = CommonTools::GET('sort');
if ($signupid == null || !is_int(intval($signupid)) || $signupid < 0) {
    // Id is not an
    header("Location: " . $configurations->webRoot);
}
// Create gadget and get the data from database
$signupGadget = new SignupGadget($signupid);
$signupGadget->sortAnswers($sort);
//Set page title
$page->title = $signupGadget->getTitle();
// Prints title and description
$page->addContent("<div id=\"signup-info\">");
$page->addContent("<h3 id=\"signup-title\"><span>" . $signupGadget->getTitle() . "</span></h3>");
$page->addContent("<p id=\"signup-description\"><span>" . CommonTools::newlineToBr($signupGadget->getDescription()) . "</span></p>");
// Check the state of signup (open/close/not yet open)
if ($signupGadget->isOpen()) {
    $page->addContent("<p id=\"signup-open\"><span>Ilmoittautuminen on auki</span></p>");
    $page->addContent("</div>");
    $page->addContent("<form id=\"signup-button-form\" method=\"get\" action=\"" . $configurations->webRoot . "queue/" . $signupid . "\">");
    // $page->addContent("<input type=\"hidden\" name=\"signupid\" value=\"$signupid\" />");
    $page->addContent("<input id=\"signup-button\" value=\"Ilmoittaudu\" type=\"submit\" />");
    $page->addContent("</form>");
    $page->addContent("<div id=\"answers-container\">");
    $page->addContent(SignupGadgetAnswerFormater::getAnswersInPrintableFormat($signupGadget));
    $page->addContent("</div>");
} else {
    if ($signupGadget->isClosed()) {
开发者ID:Alphenus,项目名称:ilmomasiina-php,代码行数:31,代码来源:signup.php

示例5: User

    if ($action == "continueandcancelold") {
        $user = new User($signupid);
        $user->cancelUnconfirmedSignupAndRefreshSession();
        header("Location: " . $configurations->webRoot . "confirm/" . $user->getNewSignupId());
    } else {
        // Check that signup is open
        $newSignupGadget = new SignupGadget($signupid);
        $user = null;
        if ($newSignupGadget->isOpen()) {
            $user = new User($signupid);
        } else {
            $debugger->error("Ilmoittautuminen ei ole avoinna.", "queue.php");
        }
        if ($user->getUnconfirmedSignupExists()) {
            $debugger->debug("Unconfirmed signup exists", "queue.php");
            if ($user->getUnconfirmedSignupIsNotTheSameAsThis()) {
                $debugger->debug("Unconfirmed signup exists, but it is not this one", "queue.php");
                $signupgadget = new SignupGadget($user->getOldSignupId());
                $page->addContent("<p><b>Huom!</b> Olet ilmoittautunut jo ilmomasiinassa <b>" . $signupgadget->getTitle() . "</b>, muttet ole vahvistanut ilmoittautumista. " . "Ennen kuin voit ilmoittautua toiseen ilmomasiinaan sinun pitää vahvistaa tai peruuttaa" . " aikasemmat vahvistamattomat ilmoittautumiset.</p>");
                $page->addContent("<p>Valitse mitä haluat tehdä:</p>");
                $page->addContent("<p> >> <a href=\"" . $configurations->webRoot . "continueandcancelold/" . $user->getNewSignupId() . "\">Peruuta aiempi vahvistamaton ilmoittautuminen ja " . "siirry eteenpäin</a></p>");
                $page->addContent("<p> >> <a href=\"" . $configurations->webRoot . "confirmold/" . $user->getOldSignupId() . "\">Siirry vahvistamaan aiempi ilmoittautuminen</a></p>");
                $page->printPage();
            } else {
                header("Location: " . $configurations->webRoot . "confirm/" . $user->getNewSignupId());
            }
        } else {
            header("Location: " . $configurations->webRoot . "confirm/" . $user->getNewSignupId());
        }
    }
}
开发者ID:Alphenus,项目名称:ilmomasiina-php,代码行数:31,代码来源:queue.php

示例6: Button

$nav->add(new Button('', array(), array(), 'a', '#', 'EX4', '', true));
$nav->add(new Button('', array(), array(), 'a', 'example-5.php', 'EX5', '', false));
/**
 * Configure page footer (Footer).
 */
$p->footer()->addButton('EX1', 'example-1.php', '', 'arrow-l');
$p->footer()->addButton('EX2', 'example-2.php', '', 'arrow-l');
$p->footer()->addButton('EX3', 'example-3.php', '', 'arrow-l');
$p->footer()->addButton('EX4', '#', '', 'check', true);
$p->footer()->addButton('EX5', 'example-5.php', '', 'arrow-r');
$p->footer()->group(true)->uiBar(true)->theme('a');
/**
 * Create and config a new form object and add items.
 */
$p->content()->add('<h1>Adding Form Elements</h1>');
$form = $p->addContent(new Form(), true);
$form->action('example-4.php?rand=' . rand(0, 9999))->method('POST');
/**
 * Add some input objects.
 */
$form->add('<h3>Text Inputs</h3>');
$form->add(new Input('uid', 'uid', 'text', '', 'Username:', '', true));
$form->add(new Input('pwd', 'pwd', 'password', '', 'Password:', '', true));
$form->add(new Input('find', 'find', 'search', '', 'Search:', '', true));
/**
 * Add a textarea object.
 */
$form->add('<h3>Textarea</h3>');
$form->add(new Textarea('msg', 'msg', '', '80', '4', 'Comments:', '', true));
/**
 * Add a jqmRange object.
开发者ID:TechnoSoluciones,项目名称:B2C,代码行数:31,代码来源:example-4.php

示例7: Configurations

<?php

/* Requirements */
require_once "classes/Configurations.php";
require_once "classes/Page.php";
require_once "classes/Debugger.php";
require_once "classes/SignupGadget.php";
require_once "classes/CommonTools.php";
/* Implementations of the most critical classes */
$configurations = new Configurations();
$page = new Page(1);
$debugger = new Debugger();
$database = new Database();
/* The code */
$signupGadget = SignupGadget::createSignupGadgetFromPost();
$signupGadget->insertToDatabase();
$password = $signupGadget->getPassword();
$linkToAnswers = $configurations->webRoot . "answers/";
$page->addContent("<h3 id=\"successful\">Ilmomasiina luotiin onnistuneesti</h3>");
$page->addContent("<p>Ulkopuoliset käyttäjät voivat tarvittaessa katsoa ilmoittautumisen " . "vastauksia osoitteesta <a href=\"{$linkToAnswers}\">{$linkToAnswers}</a> " . "masiinakohtaisella salasanalla. </p>");
$page->addContent("<p>Salasana tälle masiinalle on <strong>{$password}</strong>");
$page->addContent("<p><a href=\"" . $configurations->webRoot . "\">Palaa etusivulle</a></p>");
$page->printPage();
开发者ID:Alphenus,项目名称:ilmomasiina-php,代码行数:23,代码来源:save.php

示例8: Page

     break;
 default:
     // Implementations of the most critical classes
     // $configurations                 = new Configurations();
     $page = new Page();
     $debugger = new Debugger();
     $database = new Database();
     // The code
     $signupGadgets = new SignupGadgets();
     $signupGadgets->selectOpenGadgetsOrClosedDuringLastDays(7);
     // Get all selected gadgets to array
     $signupGadgets_array = $signupGadgets->getSignupGadgets();
     //Set the default title
     $page->title = "Ilmomasiina";
     // Print table headers
     $page->addContent("<table id=\"signup-gadgets\">");
     $page->addContent("<tr id=\"signup-header-row\">");
     $page->addContent("<th id=\"signup-name-header\">Ilmo</th><th id=\"signup-opens-header\">Avautuu</th><th id=\"signup-closes-header\">Sulkeutuu</th><th id=\"open-close-state-header\">Tila</th>");
     $page->addContent("</tr>");
     foreach ($signupGadgets_array as $gadget) {
         $page->addContent("<tr class=\"answer-row\">");
         $page->addContent("<td class=\"signup-name\"><a href=\"signup/" . $gadget->getId() . "\">" . $gadget->getTitle() . "</a></td>");
         $page->addContent("<td class=\"signup-opens\">" . $gadget->getOpeningTime() . "</td>");
         $page->addContent("<td class=\"signup-closes\">" . $gadget->getClosingTime() . "</td>");
         if ($gadget->isOpen()) {
             $page->addContent("<td class=\"open-close-state\"><span class=\"signup-open\">Auki</span></td>");
         } else {
             if ($gadget->willBeOpened()) {
                 $page->addContent("<td class=\"open-close-state\"><span class=\"signup-not-yet-open\">Ei vielä avautunut</td>\n");
             } else {
                 $page->addContent("<td class=\"open-close-state\"><span class=\"signup-closed\">Sulkeutunut</td>\n");
开发者ID:rap1ds,项目名称:ilmomasiina,代码行数:31,代码来源:index.php

示例9: Container

 * @filesource
 */
/**
 * Create a new Php object.
 */
$j = new Container();
/**
 * Create a new Page object and populate it
 */
$p = new Page('example-2');
$p->theme('b');
$p->title('Example 2');
$p->header()->addButton('Example 1', 'example-1.php', 'a', 'arrow-l');
$p->header()->addButton('Example 3', 'example-3.php', 'b', 'arrow-r');
$p->header()->theme('a');
$p->addContent('<h1>Adding Pages</h1>');
$p->addContent('<p>In this example we create a Page,');
$p->addContent(' add content and Buttons to the Header.');
$p->addContent(' After we add the page to Container object.</p>');
$p->addContent('<a href="index.php" data-role="button" data-theme="a">Home</a>');
$p->addContent('<a href="example-3.php" data-role="button">Example 3</a>');
$p->footer()->title('Example 2 Footer');
$p->footer()->position('fixed');
$p->footer()->theme('a');
/**
 * Add the page to Container object.
 */
$j->addPage($p);
/**
 * Have the container generate the HTML code.
 */
开发者ID:TechnoSoluciones,项目名称:B2C,代码行数:31,代码来源:example-2.php

示例10: Button

$nav->add(new Button('', array(), array(), 'a', 'example-3.php', 'EX3', '', false));
$nav->add(new Button('', array(), array(), 'a', 'example-4.php', 'EX4', '', false));
$nav->add(new Button('', array(), array(), 'a', '#', 'EX5', '', true));
/**
 * Configure page footer (Footer).
 */
$p->footer()->addButton('EX1', 'example-1.php', '', 'arrow-l');
$p->footer()->addButton('EX2', 'example-2.php', '', 'arrow-l');
$p->footer()->addButton('EX3', 'example-3.php', '', 'arrow-l');
$p->footer()->addButton('EX4', 'example-4.php', '', 'arrow-l');
$p->footer()->addButton('EX5', '#', '', 'check', true);
$p->footer()->group(true)->uiBar(true)->theme('a');
/**
 * Create and config a new listview object and add Basic Items.
 */
$p->addContent('<h1>Adding Listviews</h1>');
$p->addContent('<h3>Basic</h3>');
$list1 = new Listview();
$list1->addDivider('Basic Examples', '2')->inset(true);
$list1->addBasic('Example 1', 'example-1.php');
$list1->addBasic('Example 2', 'example-2.php');
$list1->addDivider('Advanced Examples', '3')->inset(true);
$list1->addBasic('Example 3', 'example-3.php');
$list1->addBasic('Example 4', 'example-4.php');
$list1->addBasic('Example 5', '#');
$p->addContent($list1);
echo $j->addPage($p);
exit;
/**
 * Create and config a new listview object and add Icon Items.
 */
开发者ID:TechnoSoluciones,项目名称:B2C,代码行数:31,代码来源:example-5.php

示例11: Configurations

/* Requirements */
require_once "classes/Configurations.php";
require_once "classes/Page.php";
require_once "classes/Debugger.php";
require_once "classes/Database.php";
require_once "classes/SignupGadget.php";
require_once "classes/CommonTools.php";
require_once "classes/User.php";
require_once "classes/SignupGadgetQuestionFormater.php";
/* Implementations of the most critical classes */
$configurations = new Configurations();
$page = new Page(3);
$debugger = new Debugger();
$database = new Database();
/* Variables from outside */
$userId = CommonTools::GET("userid");
$signupId = $request->getSignupId();
$signupGadget = new SignupGadget($signupId);
/* The code */
$page->addContent("<form id=\"kysymykset\" method=\"post\" action=\"" . $configurations->webRoot . "admin/updateanswer\">");
$page->addContent("<input type=\"hidden\" name=\"userid\" value=\"" . $userId . "\">");
$page->addContent("<input type=\"hidden\" name=\"signupid\" value=\"" . $signupId . "\">");
$page->addContent(SignupGadgetQuestionFormater::getQuestionsInPrintableFormat($signupGadget, $userId));
$page->addContent("<input type=\"hidden\" name=\"question_ids\" value=\"" . $signupGadget->getFormatedQuestionIds() . "\">");
$page->addContent("<input id=\"vahvista\" type=\"submit\" value=\"Tallenna muutokset\">");
$page->addContent("</form><br>");
$page->addContent("<form id=\"peru\" method=\"post\" action=\"" . $configurations->webRoot . "admin/showanswers/{$signupId}\">");
$page->addContent("<input id=\"peru\" type=\"submit\" value=\"Peruuta\">");
$page->addContent("</form>");
$page->printPage();
开发者ID:Alphenus,项目名称:ilmomasiina-php,代码行数:30,代码来源:edit.php

示例12: SignupGadget

$signupId = $request->getSignupId();
/* The code */
$signupGadget = new SignupGadget($signupId);
$user = new User($signupId);
if ($user->unconfirmedSignupExists) {
    if ($user->unconfirmedSignupIsNotTheSameAsThis) {
        $debugger->error("Olet ilmoittautunut johonkin toiseen ilmomasiinaan", "confirm.php");
    } else {
        // Nice! User is signed up to this signup form!
    }
} else {
    $debugger->error("Et ole vielä ilmoittautunut tai ilmoittautumisesi on vanhentunut. Ilmoittautumisen vahvistaminen epäonnistui.", "confirm.php");
}
$page->addHeader("<script type=\"text/javascript\" src=\"javascript/jquery.js\"></script>");
$page->addHeader("<script type=\"text/javascript\" src=\"javascript/email_validation.js\"></script>");
$page->addContent("<div id=\"signup-position-info-div\">");
$page->addContent("<p id=\"signup-position-info\"><span>Olet sijalla <strong>" . $user->getPosition() . "</strong>. Edessäsi on <strong>" . $user->getUnconfirmedSignupsBefore() . "</strong> vahvistamatonta ilmoittautumista. Ilmoittautumisaikasi oli <strong>" . $user->getReadableSignupTime() . "</strong> ja aikaa ilmoittautumisen vahvistamiseen sinulla on <strong>" . $user->getSignupTimeLeftInMinutes() . "</strong> minuuttia</span></p>");
$page->addContent("</div>");
$page->addContent("<div id=\"questions\">");
$page->addContent("<form id=\"questions-form\" method=\"post\" action=\"" . $configurations->webRoot . "save\">");
$page->addContent("<input type=\"hidden\" name=\"signupid\" value=\"{$signupId}\">");
$page->addContent("<input type=\"hidden\" name=\"userid\" value=\"" . $user->getId() . "\">");
$page->addContent(SignupGadgetQuestionFormater::getQuestionsInPrintableFormat($signupGadget));
$page->addContent("<input type=\"hidden\" name=\"question_ids\" value=\"" . $signupGadget->getFormatedQuestionIds() . "\">");
$page->addContent("<input id=\"confirm-button\" type=\"submit\" value=\"Vahvista\">");
$page->addContent("</form>");
$page->addContent("<form id=\"cancel-form\" method=\"post\" action=\"" . $configurations->webRoot . "cancel\">");
$page->addContent("<input id=\"cancel-button\" type=\"submit\" value=\"Peru ilmoittautuminen\">");
$page->addContent("</form>");
$page->addContent("</div>");
$page->printPage();
开发者ID:Alphenus,项目名称:ilmomasiina-php,代码行数:31,代码来源:confirm.php

示例13: Configurations

require_once "classes/Debugger.php";
require_once "classes/SignupGadget.php";
require_once "classes/CommonTools.php";
require_once "classes/SignupGadgetAnswerFormater.php";
/* Implementations of the most critical classes */
$configurations = new Configurations();
$page = new Page(2);
$debugger = new Debugger();
$database = new Database();
// Create gadget and get the data from database
$signupId = $request->getSignupId();
$sort = CommonTools::GET("sort");
$signupGadget = new SignupGadget($signupId);
$signupGadget->sortAnswers($sort);
// Prints title and description
$page->addContent("<h1>" . $signupGadget->getTitle() . "</h1>");
$page->addContent("<i>" . CommonTools::newlineToBr($signupGadget->getDescription()) . "</i>");
// Check the state of signup (open/close/not yet open)
if ($signupGadget->isOpen()) {
    $page->addContent("<p class=\"signupOpen\">Ilmoittautuminen on auki</p>");
    $page->addContent(SignupGadgetAnswerFormater::getAnswersInPrintableFormat($signupGadget, true));
    $page->addContent("<p class=\"csv-output\"><a href=\"" . $configurations->webRoot . "admin/csvoutput/{$signupId}\">Vastaukset csv-muodossa</a></p>");
} else {
    if ($signupGadget->isClosed()) {
        $page->addContent("<p class=\"signupClosed\">Ilmoittautuminen on sulkeutunut</p>");
        $page->addContent(SignupGadgetAnswerFormater::getAnswersInPrintableFormat($signupGadget, true));
        $page->addContent("<p class=\"csv-output\"><a href=\"" . $configurations->webRoot . "admin/csvoutput/{$signupId}\">Vastaukset csv-muodossa</a></p>");
    } else {
        $page->addContent("<p class=\"signupNotYetOpen\">Ilmoittautuminen on avautuu " . $signupGadget->getReadableOpeningTime() . "</p>");
    }
}
开发者ID:Alphenus,项目名称:ilmomasiina-php,代码行数:31,代码来源:show.php

示例14: Script

// Adding a custom CSS.
$j->head()->add(new Script('js/custom.js'));
// Adding a custom JavaScript.
//$j->body()->attribute('onload', 'initCustom();');     // Adding a custom attribute to 'body' tag.
/**
 * Create and config a page object.
 * Most methods return the object itself allowing call
 * another method on the object in sequence.
 */
$p = new Page('example-3');
$p->theme('b')->title('Example 3')->header()->addButton('Example 2', 'example-2.php', 'a', 'arrow-l')->addButton('Example 4', 'example-4.php', 'b', 'arrow-r')->theme('a');
/**
 * addContent() is alias to content()->add().
 */
$p->content()->add('<h1>Adding Objects</h1>');
$p->addContent('<h3>Controlgroup and Buttons</h3>');
/**
 * Create and config a new controlgroup object and add items.
 * Most methods of addition have the last parameter $returnAdded.
 * If it is set to 'true' the added object is returned, otherwise
 * the object that called the method is returned.
 */
$cg = $p->content()->add(new Controlgroup(), true);
$cg->dataType('vertical');
$cg->add(new Button('', array(), array(), 'a', 'index.php', 'Home', 'home', false));
$cg->add(new Button('', array(), array(), 'b', 'example-1.php', 'Example 1', 'arrow-l', false));
$cg->add(new Button('', array(), array(), 'b', 'example-2.php', 'Example 2', 'arrow-l', false));
$cg->add(new Button('', array(), array(), 'b', '#', 'Example 3', 'check', true));
$cg->add(new Button('', array(), array(), 'b', 'example-4.php', 'Example 4', 'arrow-r', false));
$cg->add(new Button('', array(), array(), 'b', 'example-5.php', 'Example 5', 'arrow-r', false));
/**
开发者ID:TechnoSoluciones,项目名称:B2C,代码行数:31,代码来源:example-3.php

示例15: Configurations

<?php

/* Requirements */
require_once "classes/Configurations.php";
require_once "classes/Page.php";
require_once "classes/SignupGadgets.php";
require_once "classes/Debugger.php";
require_once "classes/SignupGadget.php";
require_once "classes/CommonTools.php";
/* Implementations of the most critical classes */
$configurations = new Configurations();
$page = new Page(2);
$debugger = new Debugger();
$database = new Database();
/* The code */
$signupId = $request->getSignupId();
$action = $request->getAction();
$signupGadget = new SignupGadget($signupId);
if ($action == "delete-confirmed") {
    $signupGadget->deleteFromDatabase();
    header("Location: " . $configurations->webRoot . "admin");
} else {
    $page->addContent("<h1>Poista ilmomasiina</h1>");
    $page->addContent("<p>Haluatko varmasti poistaa seuraavan ilmomasiinan:</p>");
    $page->addContent("<p><b>" . $signupGadget->getTitle() . "</b></p>");
    $page->addContent("<p>" . $signupGadget->getDescription() . "</p>");
    $page->addContent("<p><a href=\"" . $configurations->webRoot . "admin/delete-confirmed/{$signupId}\">Joo</a> <a href=\"" . $configurations->webRoot . "admin\">Ei</a></p>");
    $page->printPage();
}
开发者ID:Alphenus,项目名称:ilmomasiina-php,代码行数:29,代码来源:delete.php


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