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


PHP HTML_QuickForm2::removeChild方法代码示例

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


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

示例1: array

$title->addRule('required', 'Please enter a page title.');
// Add the content field:
$content = $form->addElement('textarea', 'content');
$content->setLabel('Page Content');
$content->addFilter('trim');
$content->addRule('required', 'Please enter the page content.');
// Add the submit button:
$submit = $form->addElement('submit', 'submit', array('value' => 'Add This Page'));
// Check for a form submission:
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    // Handle the form submission
    // Validate the form data:
    if ($form->validate()) {
        // Insert into the database:
        $q = 'INSERT INTO pages (creatorId, title, content, dateAdded) VALUES (:creatorId, :title, :content, NOW())';
        $stmt = $pdo->prepare($q);
        $r = $stmt->execute(array(':creatorId' => $user->getId(), ':title' => $title->getValue(), ':content' => $content->getValue()));
        // Freeze the form upon success:
        if ($r) {
            $form->toggleFrozen(true);
            $form->removeChild($submit);
        }
    }
    // End of form validation IF.
}
// End of form submission IF.
// Show the page:
$pageTitle = 'Add a Page';
include 'includes/header.inc.php';
include 'views/add_page.html';
include 'includes/footer.inc.php';
开发者ID:raynaldmo,项目名称:php-education,代码行数:31,代码来源:add_page.php

示例2: array

$submitButton = $form->addElement('submit', 'submit', array('value' => 'Skicka'));
// Tar bort 'space' först och sist på alla värden.
$form->addRecursiveFilter('trim');
$mainTextHTML = "";
if ($form->validate()) {
    //Om sidan är riktigt ifylld.
    $mainTextHTML .= "<h2>Din information har skickats till Svenska \n        Skolföreningen. Tack för din anmälan!</h2>";
    $eMailAdr = "registrering@svenskaskolankualalumpur.com";
    $subject = "Ny anmälan till SSKL";
    $headers = WS_MAILHEADERS;
    $text = "Ny anmälan till Svenska Skolföreningen i Kuala Lumpur. \n";
    foreach ($form->getValue() as $parameter => $value) {
        $text .= $parameter . "\t" . $value . "\n";
    }
    mail($eMailAdr, $subject, $text, $headers);
    $form->removeChild($submitButton);
    // Tag bort sänd-knappen.
    $form->removeChild($kommentar);
    // Tag bort kommentarer.
    $form->toggleFrozen(true);
    // Frys formuläret inför ny visning.
    if ($debugEnable) {
        $debug .= "eMailAdr=" . $eMailAdr . " subject=" . $subject . "text=" . $text . " headers=" . $headers . "<br />\r\n";
    }
}
$renderer = HTML_QuickForm2_Renderer::factory('default')->setOption(array('group_hiddens' => true, 'group_errors' => true, 'errors_prefix' => 'Följand information saknas eller är felaktigt 
            ifylld:', 'errors_suffix' => '', 'required_note' => 'Obligatoriska fält är markerade med en 
            (<em>*</em>).'))->setTemplateForId('submit', '<div class="element">{element} or 
        <a href="/">Cancel</a></div>');
$form->render($renderer);
$mainTextHTML .= $renderer;
开发者ID:GunnarWinqvist,项目名称:SSKL,代码行数:31,代码来源:PApplication.php

示例3: VALUES

        $dbAccess->SingleQuery($query);
    } else {
        // Otherwise a new album is added to the DB.
        $album_idUser = $_SESSION['idUser'];
        $timeCreatedAlbum = $presentTime;
        $timeEditedAlbum = $presentTime;
        $query = "\n            INSERT INTO {$tableAlbum} (\n                album_idUser, \n                nameAlbum, \n                descriptionAlbum, \n                timeCreatedAlbum,\n                timeEditedAlbum)\n            VALUES (\n                '{$album_idUser}', \n                '{$nameAlbum}',\n                '{$descriptionAlbum}',\n                '{$timeCreatedAlbum}',\n                '{$timeEditedAlbum}'\n                );\n        ";
        $dbAccess->SingleQuery($query);
        $idAlbum = $dbAccess->LastId();
        if ($debugEnable) {
            $debug .= "idAlbum: " . $idAlbum . "<br /> \r\n";
        }
    }
    // Jump to next page if not in debug.
    if ($debugEnable) {
        $form->removeChild($buttons);
        // Remove buttons.
        $form->toggleFrozen(true);
        // Freeze the form for display.
        $mainTextHTML .= "<a title='Vidare' href='?p={$redirect}'>\n            <img src='images/accept.png' alt='Vidare' /></a> <br />\r\n";
    } else {
        $redirect = str_replace("&amp;", "&", $redirect);
        header('Location: ' . WS_SITELINK . "?p={$redirect}");
        exit;
    }
}
/*
 * If the form is incorrect filled it is displayed again with comments.
 */
$renderer = HTML_QuickForm2_Renderer::factory('default')->setOption(array('group_hiddens' => true, 'group_errors' => true, 'errors_prefix' => 'Följand information saknas eller är felaktigt ifylld:', 'errors_suffix' => '', 'required_note' => 'Obligatoriska fält är markerade med <em>*</em>'))->setTemplateForId('submit', '<div class="element">{element} or <a href="/">Cancel</a></div>');
$form->render($renderer);
开发者ID:GunnarWinqvist,项目名称:SSKL,代码行数:31,代码来源:PEditAlbum.php


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