This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
8
9
protected $title = 'TITLE_CONTACT';
10
11
private $form = null;
12
13
# Get contents
14
15
private function getContents() {
16
17
$contents = View::get('Blocks/Contact/Contact');
18
19
# Implement form
20
21
$this->form->implement($contents);
22
23
# ------------------------
24
25
return $contents;
26
}
27
28
# Handle request
29
30
protected function handle() {
31
32
# Create form
33
34
$this->form = new Form;
35
36
# Handle form
37
38
if ($this->form->handle(new Controller)) Request::redirect(INSTALL_PATH . '/contact?submitted');
39
40
# Display success message
41
42
if (false !== Request::get('submitted')) Messages::set('success', Language::get('CONTACT_SUCCESS_SEND'));
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.