本文整理汇总了PHP中yii\helpers\BaseUrl::home方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseUrl::home方法的具体用法?PHP BaseUrl::home怎么用?PHP BaseUrl::home使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\helpers\BaseUrl
的用法示例。
在下文中一共展示了BaseUrl::home方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionSet
public function actionSet($lang)
{
if (!Yii::$app->user->isGuest) {
Yii::$app->user->identity->scenario = 'language';
Yii::$app->user->identity->lang = $lang;
Yii::$app->user->identity->save();
}
Yii::$app->session->set('lang', $lang);
$redirectUrl = Yii::$app->request->get('redirect', false);
if (!$redirectUrl) {
$redirectUrl = Yii::$app->request->referrer;
}
if (!$redirectUrl) {
$redirectUrl = \yii\helpers\BaseUrl::home(true);
}
return $this->redirect($redirectUrl);
}
示例2:
<?php
use yii\helpers\Html;
use yii\helpers\BaseUrl;
use kartik\switchinput\SwitchInput;
?>
<tr >
<td style >
<?php
echo Html::a($model->place->name, BaseUrl::home() . '/place/' . $model->place->slug);
?>
</td>
<td style>
<?php
foreach ($model->meetingPlaceChoices as $mpc) {
if ($mpc->user_id == $model->meeting->owner_id) {
if ($mpc->status == $mpc::STATUS_YES) {
$value = 1;
} else {
$value = 0;
}
echo SwitchInput::widget(['type' => SwitchInput::CHECKBOX, 'name' => 'meeting-place-choice', 'id' => 'mpc-' . $mpc->id, 'value' => $value, 'pluginOptions' => ['size' => 'mini', 'onText' => '<i class="glyphicon glyphicon-ok"></i>', 'offText' => '<i class="glyphicon glyphicon-remove"></i>', 'onColor' => 'success', 'offColor' => 'danger']]);
}
}
?>
</td>
<td style>
<?php
foreach ($model->meetingPlaceChoices as $mpc) {
if (count($model->meeting->participants) == 0) {
示例3:
admin/race">Carreras</a></li>
<li><a href="<?php
echo BaseUrl::home();
?>
admin/user">Usuarios</a></li>
<li><a href="<?php
echo BaseUrl::home();
?>
admin/category">Categorias</a></li>
</ul>
<?php
} else {
?>
<ul>
<li><a href="<?php
echo BaseUrl::home();
?>
admin/user/racer">Inscribir corredor</a></li>
</ul>
<?php
}
} else {
?>
<a href="<?php
echo BaseUrl::home();
?>
admin/default/login">Login</a>
<?php
}
?>
</div>
示例4:
$this->head();
?>
</head>
<body>
<?php
$this->beginBody();
?>
<div class="container" id="page">
<nav id="header" class="navbar navbar-default">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<a class="navbar-brand" href="<?php
echo \yii\helpers\BaseUrl::home();
?>
">
E-books
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="#">Most Viewed</a></li>
<li><a href="#">Top Downloads</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
<form class="navbar-form navbar-right" role="search">