Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
6e997cb4
Commit
6e997cb4
authored
May 03, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved contact page.
parent
147b3155
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
11 deletions
+17
-11
SiteController.php
app/protected/controllers/SiteController.php
+1
-1
contact.php
app/protected/views/site/contact.php
+12
-5
login.php
app/protected/views/site/login.php
+3
-4
Session.php
framework/web/Session.php
+1
-1
No files found.
app/protected/controllers/SiteController.php
View file @
6e997cb4
...
...
@@ -33,7 +33,7 @@ class SiteController extends Controller
{
$model
=
new
ContactForm
;
if
(
$this
->
populate
(
$_POST
,
$model
)
&&
$model
->
contact
(
Yii
::
$app
->
params
[
'adminEmail'
]))
{
Yii
::
$app
->
session
->
setFlash
(
'contact
'
,
'Thank you for contacting us. We will respond to you as soon as possible.
'
);
Yii
::
$app
->
session
->
setFlash
(
'contact
FormSubmitted
'
);
Yii
::
$app
->
response
->
refresh
();
}
else
{
echo
$this
->
render
(
'contact'
,
array
(
...
...
app/protected/views/site/contact.php
View file @
6e997cb4
...
...
@@ -9,7 +9,15 @@ $this->title = 'Contact';
?>
<h1>
<?php
echo
Html
::
encode
(
$this
->
title
);
?>
</h1>
<p>
Please fill out the following fields:
</p>
<?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>
<?php
return
;
endif
;
?>
<p>
If you have business inquiries or other questions, please fill out the following form to contact us. Thank you.
</p>
<?php
$form
=
$this
->
beginWidget
(
'yii\widgets\ActiveForm'
,
array
(
'options'
=>
array
(
'class'
=>
'form-horizontal'
),
...
...
@@ -19,9 +27,7 @@ $this->title = 'Contact';
<?php
echo
$form
->
field
(
$model
,
'email'
)
->
textInput
();
?>
<?php
echo
$form
->
field
(
$model
,
'subject'
)
->
textInput
();
?>
<?php
echo
$form
->
field
(
$model
,
'body'
)
->
textArea
(
array
(
'rows'
=>
6
));
?>
<div
class=
"control-group"
>
<div
class=
"controls"
>
<?php
echo
Html
::
submitButton
(
'Submit'
,
null
,
null
,
array
(
'class'
=>
'btn btn-primary'
));
?>
</div>
<div
class=
"form-actions"
>
<?php
echo
Html
::
submitButton
(
'Submit'
,
null
,
null
,
array
(
'class'
=>
'btn btn-primary'
));
?>
</div>
<?php
$this
->
endWidget
();
?>
\ No newline at end of file
app/protected/views/site/login.php
View file @
6e997cb4
...
...
@@ -15,9 +15,7 @@ $this->title = 'Login';
<?php
echo
$form
->
field
(
$model
,
'username'
)
->
textInput
();
?>
<?php
echo
$form
->
field
(
$model
,
'password'
)
->
passwordInput
();
?>
<?php
echo
$form
->
field
(
$model
,
'rememberMe'
)
->
checkbox
();
?>
<div
class=
"control-group"
>
<div
class=
"controls"
>
<?php
echo
Html
::
submitButton
(
'Login'
,
null
,
null
,
array
(
'class'
=>
'btn btn-primary'
));
?>
</div>
<div
class=
"form-actions"
>
<?php
echo
Html
::
submitButton
(
'Login'
,
null
,
null
,
array
(
'class'
=>
'btn btn-primary'
));
?>
</div>
<?php
$this
->
endWidget
();
?>
\ No newline at end of file
framework/web/Session.php
View file @
6e997cb4
...
...
@@ -587,7 +587,7 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
* session variable using the same name, its value will be overwritten by this method.
* @param mixed $value flash message
*/
public
function
setFlash
(
$key
,
$value
)
public
function
setFlash
(
$key
,
$value
=
true
)
{
$counters
=
$this
->
get
(
$this
->
flashVar
,
array
());
$counters
[
$key
]
=
0
;
...
...
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