Initial commit
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
/** @var string $content */
|
||||
|
||||
use app\assets\AppAsset;
|
||||
use app\widgets\Alert;
|
||||
use yii\bootstrap5\Breadcrumbs;
|
||||
use yii\bootstrap5\Html;
|
||||
use yii\bootstrap5\Nav;
|
||||
use yii\bootstrap5\NavBar;
|
||||
|
||||
AppAsset::register($this);
|
||||
|
||||
$this->registerCsrfMetaTags();
|
||||
$this->registerMetaTag(['charset' => Yii::$app->charset], 'charset');
|
||||
$this->registerMetaTag(['name' => 'viewport', 'content' => 'width=device-width, initial-scale=1, shrink-to-fit=no']);
|
||||
$this->registerMetaTag(['name' => 'description', 'content' => $this->params['meta_description'] ?? '']);
|
||||
$this->registerMetaTag(['name' => 'keywords', 'content' => $this->params['meta_keywords'] ?? '']);
|
||||
$this->registerLinkTag(['rel' => 'icon', 'type' => 'image/x-icon', 'href' => Yii::getAlias('@web/favicon.ico')]);
|
||||
?>
|
||||
<?php $this->beginPage() ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?= Yii::$app->language ?>" class="h-100">
|
||||
<head>
|
||||
<title><?= Html::encode($this->title) ?></title>
|
||||
<?php $this->head() ?>
|
||||
</head>
|
||||
<body class="d-flex flex-column h-100">
|
||||
<?php $this->beginBody() ?>
|
||||
|
||||
<header id="header">
|
||||
<?php
|
||||
NavBar::begin([
|
||||
'brandLabel' => Yii::$app->name,
|
||||
'brandUrl' => Yii::$app->homeUrl,
|
||||
'options' => ['class' => 'navbar-expand-md navbar-dark bg-dark fixed-top']
|
||||
]);
|
||||
echo Nav::widget([
|
||||
'options' => ['class' => 'navbar-nav'],
|
||||
'items' => [
|
||||
['label' => 'Home', 'url' => ['/site/index']],
|
||||
['label' => 'About', 'url' => ['/site/about']],
|
||||
['label' => 'Contact', 'url' => ['/site/contact']],
|
||||
Yii::$app->user->isGuest
|
||||
? ['label' => 'Login', 'url' => ['/site/login']]
|
||||
: '<li class="nav-item">'
|
||||
. Html::beginForm(['/site/logout'])
|
||||
. Html::submitButton(
|
||||
'Logout (' . Yii::$app->user->identity->username . ')',
|
||||
['class' => 'nav-link btn btn-link logout']
|
||||
)
|
||||
. Html::endForm()
|
||||
. '</li>'
|
||||
]
|
||||
]);
|
||||
NavBar::end();
|
||||
?>
|
||||
</header>
|
||||
|
||||
<main id="main" class="flex-shrink-0" role="main">
|
||||
<div class="container">
|
||||
<?php if (!empty($this->params['breadcrumbs'])): ?>
|
||||
<?= Breadcrumbs::widget(['links' => $this->params['breadcrumbs']]) ?>
|
||||
<?php endif ?>
|
||||
<?= Alert::widget() ?>
|
||||
<?= $content ?>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer id="footer" class="mt-auto py-3 bg-light">
|
||||
<div class="container">
|
||||
<div class="row text-muted">
|
||||
<div class="col-md-6 text-center text-md-start">© My Company <?= date('Y') ?></div>
|
||||
<div class="col-md-6 text-center text-md-end"><?= Yii::powered() ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<?php $this->endBody() ?>
|
||||
</body>
|
||||
</html>
|
||||
<?php $this->endPage() ?>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
$this->title = 'About';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="site-about">
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
This is the About page. You may modify the following file to customize its content:
|
||||
</p>
|
||||
|
||||
<code><?= __FILE__ ?></code>
|
||||
</div>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
/** @var yii\bootstrap5\ActiveForm $form */
|
||||
/** @var app\models\ContactForm $model */
|
||||
|
||||
use yii\bootstrap5\ActiveForm;
|
||||
use yii\bootstrap5\Html;
|
||||
use yii\captcha\Captcha;
|
||||
|
||||
$this->title = 'Contact';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="site-contact">
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?php if (Yii::$app->session->hasFlash('contactFormSubmitted')): ?>
|
||||
|
||||
<div class="alert alert-success">
|
||||
Thank you for contacting us. We will respond to you as soon as possible.
|
||||
</div>
|
||||
|
||||
<p>
|
||||
Note that if you turn on the Yii debugger, you should be able
|
||||
to view the mail message on the mail panel of the debugger.
|
||||
<?php if (Yii::$app->mailer->useFileTransport): ?>
|
||||
Because the application is in development mode, the email is not sent but saved as
|
||||
a file under <code><?= Yii::getAlias(Yii::$app->mailer->fileTransportPath) ?></code>.
|
||||
Please configure the <code>useFileTransport</code> property of the <code>mail</code>
|
||||
application component to be false to enable email sending.
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<p>
|
||||
If you have business inquiries or other questions, please fill out the following form to contact us.
|
||||
Thank you.
|
||||
</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-5">
|
||||
|
||||
<?php $form = ActiveForm::begin(['id' => 'contact-form']); ?>
|
||||
|
||||
<?= $form->field($model, 'name')->textInput(['autofocus' => true]) ?>
|
||||
|
||||
<?= $form->field($model, 'email') ?>
|
||||
|
||||
<?= $form->field($model, 'subject') ?>
|
||||
|
||||
<?= $form->field($model, 'body')->textarea(['rows' => 6]) ?>
|
||||
|
||||
<?= $form->field($model, 'verifyCode')->widget(Captcha::class, [
|
||||
'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>',
|
||||
]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Submit', ['class' => 'btn btn-primary', 'name' => 'contact-button']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
/** @var string $name */
|
||||
/** @var string $message */
|
||||
/** @var Exception $exception */
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
$this->title = $name;
|
||||
?>
|
||||
<div class="site-error">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<div class="alert alert-danger">
|
||||
<?= nl2br(Html::encode($message)) ?>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
The above error occurred while the Web server was processing your request.
|
||||
</p>
|
||||
<p>
|
||||
Please contact us if you think this is a server error. Thank you.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
|
||||
$this->title = 'My Yii Application';
|
||||
?>
|
||||
<div class="site-index">
|
||||
|
||||
<div class="jumbotron text-center bg-transparent mt-5 mb-5">
|
||||
<h1 class="display-4">Congratulations!</h1>
|
||||
|
||||
<p class="lead">You have successfully created your Yii-powered application.</p>
|
||||
|
||||
<p><a class="btn btn-lg btn-success" href="https://www.yiiframework.com">Get started with Yii</a></p>
|
||||
</div>
|
||||
|
||||
<div class="body-content">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-4 mb-3">
|
||||
<h2>Heading</h2>
|
||||
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
|
||||
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
|
||||
ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
|
||||
fugiat nulla pariatur.</p>
|
||||
|
||||
<p><a class="btn btn-outline-secondary" href="https://www.yiiframework.com/doc/">Yii Documentation »</a></p>
|
||||
</div>
|
||||
<div class="col-lg-4 mb-3">
|
||||
<h2>Heading</h2>
|
||||
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
|
||||
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
|
||||
ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
|
||||
fugiat nulla pariatur.</p>
|
||||
|
||||
<p><a class="btn btn-outline-secondary" href="https://www.yiiframework.com/forum/">Yii Forum »</a></p>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<h2>Heading</h2>
|
||||
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
|
||||
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
|
||||
ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
|
||||
fugiat nulla pariatur.</p>
|
||||
|
||||
<p><a class="btn btn-outline-secondary" href="https://www.yiiframework.com/extensions/">Yii Extensions »</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
/** @var yii\bootstrap5\ActiveForm $form */
|
||||
|
||||
/** @var app\models\LoginForm $model */
|
||||
|
||||
use yii\bootstrap5\ActiveForm;
|
||||
use yii\bootstrap5\Html;
|
||||
|
||||
$this->title = 'Login';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="site-login">
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>Please fill out the following fields to login:</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-5">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'id' => 'login-form',
|
||||
'fieldConfig' => [
|
||||
'template' => "{label}\n{input}\n{error}",
|
||||
'labelOptions' => ['class' => 'col-lg-1 col-form-label mr-lg-3'],
|
||||
'inputOptions' => ['class' => 'col-lg-3 form-control'],
|
||||
'errorOptions' => ['class' => 'col-lg-7 invalid-feedback'],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'username')->textInput(['autofocus' => true]) ?>
|
||||
|
||||
<?= $form->field($model, 'password')->passwordInput() ?>
|
||||
|
||||
<?= $form->field($model, 'rememberMe')->checkbox([
|
||||
'template' => "<div class=\"custom-control custom-checkbox\">{input} {label}</div>\n<div class=\"col-lg-8\">{error}</div>",
|
||||
]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<?= Html::submitButton('Login', ['class' => 'btn btn-primary', 'name' => 'login-button']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
<div style="color:#999;">
|
||||
You may login with <strong>admin/admin</strong> or <strong>demo/demo</strong>.<br>
|
||||
To modify the username/password, please check out the code <code>app\models\User::$users</code>.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user