本文整理汇总了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">