當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TbHtml::errorSummary方法代碼示例

本文整理匯總了PHP中TbHtml::errorSummary方法的典型用法代碼示例。如果您正苦於以下問題:PHP TbHtml::errorSummary方法的具體用法?PHP TbHtml::errorSummary怎麽用?PHP TbHtml::errorSummary使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TbHtml的用法示例。


在下文中一共展示了TbHtml::errorSummary方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1:

    <title>Installation</title>

    <link rel="stylesheet" type="text/css" href="<?php 
echo Bootstrap::getBooster()->getAssetsUrl();
?>
/bootstrap/css/bootstrap.min.css" />
</head>
<body>
    <div class="span6 offset3">
        <h1 class="offset1">Installation</h1>
        <h2 class="offset1"><small>Enter admin credentials</small></h2>
        <?php 
if ($model->hasErrors()) {
    ?>
            <?php 
    echo TbHtml::errorSummary($model);
    ?>
        <?php 
}
?>

        <form method="post" class="form-horizontal">

            <?php 
echo TbHtml::activeTextFieldControlGroup($model, 'username');
?>
            <?php 
echo TbHtml::activePasswordFieldControlGroup($model, 'password');
?>
            <?php 
echo TbHtml::activePasswordFieldControlGroup($model, 'password_verify');
開發者ID:xunicorn,項目名稱:ebay-simple-watching,代碼行數:31,代碼來源:install.php

示例2:

<div class="success">
<?php 
    echo Yii::app()->user->getFlash('recoveryMessage');
    ?>
</div>
<?php 
} else {
    ?>

<div class="form">
<?php 
    echo TbHtml::beginForm();
    ?>

	<?php 
    echo TbHtml::errorSummary($form);
    ?>
	
	<div class="row-fluid">
		<?php 
    echo TbHtml::activeLabel($form, 'login_or_email');
    ?>
		<?php 
    echo TbHtml::activeTextField($form, 'login_or_email');
    ?>
		<p class="hint"><?php 
    echo UserModule::t("Please enter your login or email addres.");
    ?>
</p>
	</div>
	
開發者ID:Rudianasaja,項目名稱:cycommerce,代碼行數:30,代碼來源:recovery.php

示例3: errorSummary

 /**
  * Displays a summary of validation errors for one or several models.
  * @param mixed $models the models whose input errors are to be displayed.
  * @param string $header a piece of HTML code that appears in front of the errors
  * @param string $footer a piece of HTML code that appears at the end of the errors
  * @param array $htmlOptions additional HTML attributes to be rendered in the container div tag.
  * @return string the error summary. Empty if no errors are found.
  */
 public function errorSummary($models, $header = null, $footer = null, $htmlOptions = array())
 {
     if (!$this->enableAjaxValidation && !$this->enableClientValidation) {
         return TbHtml::errorSummary($models, $header, $footer, $htmlOptions);
     }
     TbArray::defaultValue('id', $this->id . '_es_', $htmlOptions);
     $html = TbHtml::errorSummary($models, $header, $footer, $htmlOptions);
     if ($html === '') {
         if ($header === null) {
             $header = '<p>' . Yii::t('yii', 'Please fix the following input errors:') . '</p>';
         }
         TbHtml::addCssClass(TbHtml::$errorSummaryCss, $htmlOptions);
         TbHtml::addCssStyle('display:none', $htmlOptions);
         $html = CHtml::tag('div', $htmlOptions, $header . '<ul><li>dummy</li></ul>' . $footer);
     }
     $this->summaryID = $htmlOptions['id'];
     return $html;
 }
開發者ID:zwq,項目名稱:unpei,代碼行數:26,代碼來源:TbActiveForm.php

示例4: testErrorSummary

 public function testErrorSummary()
 {
     $I = $this->codeGuy;
     $model = new Dummy();
     $model->addError('text', 'Error text');
     $html = TbHtml::errorSummary($model, 'Header text', 'Footer text', array('class' => 'summary'));
     $div = $I->createNode($html, 'div.alert');
     $I->seeNodeCssClass($div, 'alert-block alert-error summary');
     $I->seeNodePattern($div, '/^Header text/');
     $I->seeNodePattern($div, '/Footer text$/');
     $li = $div->filter('ul > li')->first();
     $I->seeNodeText($li, 'Error text');
 }
開發者ID:AlexanderGrant1,項目名稱:AC41004,代碼行數:13,代碼來源:TbHtmlTest.php


注:本文中的TbHtml::errorSummary方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。