1 | <?php |
||
12 | class SiteController extends Controller |
||
13 | { |
||
14 | /** |
||
15 | * Undocumented variable |
||
16 | * |
||
17 | * @var [type] |
||
18 | */ |
||
19 | public $app; |
||
20 | |||
21 | /** |
||
22 | * {@inheritdoc} |
||
23 | */ |
||
24 | 10 | public function behaviors() |
|
25 | { |
||
26 | return [ |
||
27 | 'access' => [ |
||
28 | 10 | 'class' => AccessControl::class, |
|
29 | 'only' => ['logout'], |
||
30 | 'rules' => [ |
||
31 | [ |
||
32 | 'actions' => ['logout'], |
||
33 | 'allow' => true, |
||
34 | 'roles' => ['@'], |
||
35 | ], |
||
36 | ], |
||
37 | ], |
||
38 | 'verbs' => [ |
||
39 | 'class' => VerbFilter::class, |
||
40 | 'actions' => [ |
||
41 | 'logout' => ['post'], |
||
42 | ], |
||
43 | ], |
||
44 | ]; |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | */ |
||
50 | 10 | public function actions() |
|
62 | |||
63 | /** |
||
64 | * Displays homepage. |
||
65 | * |
||
66 | * @return string |
||
67 | */ |
||
68 | 1 | public function actionIndex() |
|
69 | { |
||
70 | 1 | return $this->render('index'); |
|
71 | } |
||
72 | |||
73 | /** |
||
74 | * actionAbout. |
||
75 | * |
||
76 | * displays about page |
||
77 | * |
||
78 | * @return string |
||
79 | **/ |
||
80 | 1 | public function actionAbout() |
|
81 | { |
||
82 | 1 | return $this->render('about'); |
|
83 | } |
||
84 | |||
85 | /** |
||
86 | * actionContact. |
||
87 | * |
||
88 | * displays contact page |
||
89 | * |
||
90 | * @return response|string |
||
91 | **/ |
||
92 | 8 | public function actionContact() |
|
107 | |||
108 | /** |
||
109 | * sendContactForm. |
||
110 | * |
||
111 | * sends an email to the specified email address using the information collected by this model |
||
112 | * |
||
113 | * @param string $email the target email address |
||
114 | * @param Model $model |
||
115 | * |
||
116 | * @return bool whether the model passes validation |
||
117 | **/ |
||
118 | 3 | public function sendContact(string $email, Model $model) |
|
128 | } |
||
129 |