Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yii2bootstrap
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
yii2bootstrap
Commits
0d182ace
Commit
0d182ace
authored
May 03, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
basic app WIP
parent
91002172
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
210 additions
and
20 deletions
+210
-20
site.css
app/css/site.css
+78
-0
assets.php
app/protected/config/assets.php
+19
-0
main.php
app/protected/config/main.php
+4
-1
SiteController.php
app/protected/controllers/SiteController.php
+10
-0
main.php
app/protected/views/layouts/main.php
+36
-7
about.php
app/protected/views/site/about.php
+8
-0
contact.php
app/protected/views/site/contact.php
+10
-0
index.php
app/protected/views/site/index.php
+43
-11
login.php
app/protected/views/site/login.php
+2
-1
No files found.
app/css/site.css
0 → 100644
View file @
0d182ace
body
{
padding-top
:
20px
;
padding-bottom
:
60px
;
}
/* Custom container */
.container
{
margin
:
0
auto
;
max-width
:
1000px
;
}
.container
>
hr
{
margin
:
60px
0
;
}
/* Main marketing message and sign up button */
.jumbotron
{
margin
:
80px
0
;
text-align
:
center
;
}
.jumbotron
h1
{
font-size
:
100px
;
line-height
:
1
;
}
.jumbotron
.lead
{
font-size
:
24px
;
line-height
:
1.25
;
}
.jumbotron
.btn
{
font-size
:
21px
;
padding
:
14px
24px
;
}
/* Supporting marketing content */
.marketing
{
margin
:
60px
0
;
}
.marketing
p
+
h4
{
margin-top
:
28px
;
}
/* Customize the navbar links to be fill the entire space of the .navbar */
.navbar
.navbar-inner
{
padding
:
0
;
}
.navbar
.nav
{
margin
:
0
;
display
:
table
;
width
:
100%
;
}
.navbar
.nav
li
{
display
:
table-cell
;
width
:
1%
;
float
:
none
;
}
.navbar
.nav
li
a
{
font-weight
:
bold
;
text-align
:
center
;
border-left
:
1px
solid
rgba
(
255
,
255
,
255
,
.75
);
border-right
:
1px
solid
rgba
(
0
,
0
,
0
,
.1
);
}
.navbar
.nav
li
:first-child
a
{
border-left
:
0
;
border-radius
:
3px
0
0
3px
;
}
.navbar
.nav
li
:last-child
a
{
border-right
:
0
;
border-radius
:
0
3px
3px
0
;
}
app/protected/config/assets.php
0 → 100644
View file @
0d182ace
<?php
return
array
(
'app'
=>
array
(
'basePath'
=>
'@wwwroot'
,
'baseUrl'
=>
'@www'
,
'css'
=>
array
(
'css/bootstrap.min.css'
,
'css/bootstrap-responsive.min.css'
,
'css/site.css'
,
),
'js'
=>
array
(
),
'depends'
=>
array
(
'yii'
,
),
),
);
\ No newline at end of file
app/protected/config/main.php
View file @
0d182ace
...
...
@@ -10,6 +10,9 @@ return array(
'user'
=>
array
(
'class'
=>
'yii\web\User'
,
'identityClass'
=>
'app\models\User'
,
)
),
'assetManager'
=>
array
(
'bundles'
=>
require
(
__DIR__
.
'/assets.php'
),
),
),
);
\ No newline at end of file
app/protected/controllers/SiteController.php
View file @
0d182ace
...
...
@@ -27,4 +27,14 @@ class SiteController extends Controller
Yii
::
$app
->
getUser
()
->
logout
();
Yii
::
$app
->
getResponse
()
->
redirect
(
array
(
'site/index'
));
}
public
function
actionContact
()
{
echo
$this
->
render
(
'contact'
);
}
public
function
actionAbout
()
{
echo
$this
->
render
(
'about'
);
}
}
\ No newline at end of file
app/protected/views/layouts/main.php
View file @
0d182ace
...
...
@@ -4,23 +4,52 @@
* @var $content string
*/
use
yii\helpers\Html
;
$this
->
registerAssetBundle
(
'app'
);
?>
<?php
$this
->
beginPage
();
?>
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
/>
<meta
charset=
"utf-8"
/>
<title>
<?php
echo
Html
::
encode
(
$this
->
title
);
?>
</title>
<?php
echo
Html
::
cssFile
(
"css/bootstrap.min.css"
,
array
(
'media'
=>
'screen'
));
?>
<?php
$this
->
head
();
?>
</head>
<body>
<div
class=
"container"
>
<h1>
Welcome
</h1>
<?php
$this
->
beginBody
();
?>
<?php
echo
$content
;
?>
<?php
$this
->
endBody
();
?>
<div
class=
"container"
>
<?php
$this
->
beginBody
();
?>
<div
class=
"masthead"
>
<h3
class=
"muted"
>
My Company
</h3>
<div
class=
"navbar"
>
<div
class=
"navbar-inner"
>
<div
class=
"container"
>
<ul
class=
"nav"
>
<li>
<?php
echo
Html
::
a
(
'Home'
,
Yii
::
$app
->
homeUrl
);
?>
</li>
<li>
<?php
echo
Html
::
a
(
'About'
,
array
(
'/site/about'
));
?>
</li>
<li>
<?php
echo
Html
::
a
(
'Contact'
,
array
(
'/site/contact'
));
?>
</li>
<?php
if
(
Yii
::
$app
->
user
->
isGuest
)
:
?>
<li>
<?php
echo
Html
::
a
(
'Login'
,
array
(
'/site/login'
));
?>
</li>
<?php
else
:
?>
<li>
<?php
echo
Html
::
a
(
'Logout ('
.
Html
::
encode
(
Yii
::
$app
->
user
->
identity
->
username
)
.
')'
,
array
(
'/site/logout'
));
?>
</li>
<?php
endif
;
?>
</ul>
</div>
</div>
</div>
<!-- /.navbar -->
</div>
<?php
echo
$content
;
?>
<div
class=
"footer"
>
<p>
©
My Company
<?php
echo
date
(
'Y'
);
?>
</p>
<p>
<?php
echo
Yii
::
powered
();
?>
Template by
<a
href=
"http://twitter.github.io/bootstrap/"
>
Twitter Bootstrap
</a>
</p>
</div>
<?php
$this
->
endBody
();
?>
</div>
</body>
</html>
<?php
$this
->
endPage
();
?>
\ No newline at end of file
app/protected/views/site/about.php
0 → 100644
View file @
0d182ace
<?php
use
yii\helpers\Html
;
/**
* @var yii\base\View $this
*/
$this
->
title
=
'About'
;
?>
<h1>
<?php
echo
Html
::
encode
(
$this
->
title
);
?>
</h1>
\ No newline at end of file
app/protected/views/site/contact.php
0 → 100644
View file @
0d182ace
<?php
use
yii\helpers\Html
;
/**
* @var yii\base\View $this
* @var yii\widgets\ActiveForm $form
* @var app\models\ContactForm $model
*/
$this
->
title
=
'Contact'
;
?>
<h1>
<?php
echo
Html
::
encode
(
$this
->
title
);
?>
</h1>
app/protected/views/site/index.php
View file @
0d182ace
<?php
/** @var $this \yii\base\View */
/**
* @var yii\base\View $this
*/
$this
->
title
=
'Welcome'
;
?>
<div
class=
"jumbotron"
>
<h1>
Marketing stuff!
</h1>
use
yii\helpers\Html
;
<p
class=
"lead"
>
Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus
commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
</p>
<a
class=
"btn btn-large btn-success"
href=
"http://www.yiiframework.com"
>
Get started today
</a>
</div>
$this
->
title
=
'Hello World'
;
<hr>
$user
=
Yii
::
$app
->
getUser
();
if
(
$user
->
isGuest
)
{
echo
Html
::
a
(
'login'
,
array
(
'login'
));
}
else
{
echo
"You are logged in as "
.
$user
->
identity
->
username
.
"<br/>"
;
echo
Html
::
a
(
'logout'
,
array
(
'logout'
));
}
?>
<!-- Example row of columns -->
<div
class=
"row-fluid"
>
<div
class=
"span4"
>
<h2>
Heading
</h2>
<p>
Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris
condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod.
Donec sed odio dui.
</p>
<p><a
class=
"btn"
href=
"#"
>
View details
»
</a></p>
</div>
<div
class=
"span4"
>
<h2>
Heading
</h2>
<p>
Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris
condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod.
Donec sed odio dui.
</p>
<p><a
class=
"btn"
href=
"#"
>
View details
»
</a></p>
</div>
<div
class=
"span4"
>
<h2>
Heading
</h2>
<p>
Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta
felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum
massa.
</p>
<p><a
class=
"btn"
href=
"#"
>
View details
»
</a></p>
</div>
</div>
<hr>
app/protected/views/site/login.php
View file @
0d182ace
...
...
@@ -5,8 +5,9 @@ use yii\helpers\Html;
* @var yii\widgets\ActiveForm $form
* @var app\models\LoginForm $model
*/
$this
->
title
=
'Login'
;
?>
<h1>
Login
</h1>
<h1>
<?php
echo
Html
::
encode
(
$this
->
title
);
?>
</h1>
<p>
Please fill out the following fields to login:
</p>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment