本文整理匯總了PHP中yii\bootstrap\Html::csrfMetaTags方法的典型用法代碼示例。如果您正苦於以下問題:PHP Html::csrfMetaTags方法的具體用法?PHP Html::csrfMetaTags怎麽用?PHP Html::csrfMetaTags使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類yii\bootstrap\Html
的用法示例。
在下文中一共展示了Html::csrfMetaTags方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: initBuy
/**
* Инициализация кнопки
* @param \frontend\models\Market $market
* @return string|void
*/
public function initBuy(\frontend\models\Market $market = null)
{
if ($market && isset($market->settings)) {
$settings = json_decode($market->settings, true);
} else {
$settings = array();
}
$xml_structure = $this->getStructure();
$html = \yii\bootstrap\Html::beginForm('?r=payqr/button/create' . (isset($market->id) ? "&market_id=" . $market->id : ""), 'post', []);
$html .= \yii\bootstrap\Html::csrfMetaTags();
//инициализируем общие настройки кнопки
foreach ($xml_structure as $row) {
if (isset($row['field'][0]['@attributes']['value']) && !$this->buttonStructure($row)) {
$html .= $this->generateHtml($row, $settings);
}
}
//инициализиурем параметры кнопки в соответствии с местом отображения
foreach ($this->ShowInPlace as $place => $placeTranslate) {
foreach ($this->buttonXmlStructure as $xmlrow) {
$html .= $this->generateHtml($xmlrow, $settings, array(0 => $place, 1 => $placeTranslate));
}
}
$html .= \yii\bootstrap\Html::submitButton('Сохранить');
$html .= \yii\bootstrap\Html::endForm();
return $html;
}
示例2:
<?php
$this->beginPage();
?>
<!DOCTYPE html>
<html lang="<?php
echo Yii::$app->language;
?>
">
<head>
<meta charset="<?php
echo Yii::$app->charset;
?>
">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php
echo Html::csrfMetaTags();
?>
<title><?php
echo Html::encode($this->title);
?>
</title>
<?php
$this->head();
?>
</head>
<body>
<?php
$this->beginBody();
echo $this->render('/shared/nav');
?>
<div class="wrapper">