本文整理匯總了PHP中ValidatingForm::addSummary方法的典型用法代碼示例。如果您正苦於以下問題:PHP ValidatingForm::addSummary方法的具體用法?PHP ValidatingForm::addSummary怎麽用?PHP ValidatingForm::addSummary使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ValidatingForm
的用法示例。
在下文中一共展示了ValidatingForm::addSummary方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: stripslashes
*
* You should have received a copy of the GNU General Public License
* along with MMC; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
require "modules/samba/includes/machines.inc.php";
require "modules/samba/includes/samba.inc.php";
require "modules/samba/mainSidebar.php";
require "graph/navbar.inc.php";
if (isset($_POST["baddmach"])) {
$machine = $_POST["machine"];
$comment = stripslashes($_POST["comment"]);
add_machine($machine, $comment);
if (!isXMLRPCError()) {
new NotifyWidgetSuccess(sprintf(_T("Computer %s successfully added"), $machine));
header("Location: " . urlStrRedirect("samba/machines/index"));
exit;
}
}
$p = new PageGenerator(_T("Add a computer"));
$p->setSideMenu($sidemenu);
$p->display();
$f = new ValidatingForm();
$f->addSummary(_T("The computer name can only contains letters lowercase and numbers, and must begin with a letter."));
$f->push(new Table());
$f->add(new TrFormElement(_T("Computer name"), new NetbiosInputTpl("machine")), array("value" => $machine, "required" => True));
$f->add(new TrFormElement(_T("Comment"), new InputTpl("comment")), array("value" => $comment));
$f->pop();
$f->pop();
$f->addValidateButton("baddmach");
$f->display();