Last active
August 29, 2015 14:28
-
-
Save nsams/d6737f2f12508ad7e00f to your computer and use it in GitHub Desktop.
Static Contact Form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Contact_Component extends Kwc_Form_Component | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Contact_FrontendForm extends Kwf_Form | |
{ | |
protected function _init() | |
{ | |
$this->setModel(new Kwf_Model_Mail(array('tpl' => 'mails/Contact'))); | |
$columns = $this->add(new Kwf_Form_Container_Columns()); | |
$col = $columns->add(new Kwf_Form_Container_Column()); | |
$col->add(new Kwf_Form_Field_TextField('name', trlStatic('Vorname und Nachname'))) | |
->setWidth(320) | |
->setAllowBlank(false); | |
$col->add(new Kwf_Form_Field_TextField('phone', trlStatic('Telefonnummer'))) | |
->setAllowBlank(true) | |
->setWidth(320); | |
$col->add(new Kwf_Form_Field_TextField('email', trlStatic('E-Mail'))) | |
->setWidth(320) | |
->setVtype('email') | |
->setAllowBlank(false); | |
$col = $columns->add(new Kwf_Form_Container_Column()); | |
$col->add(new Kwf_Form_Field_TextArea('message', trlStatic('Ihre Nachricht an uns'))) | |
->setWidth(640); | |
$col = $columns->add(new Kwf_Form_Container_Column()); | |
$col->setCls('lastColumn'); | |
$col->add(new Kwf_Form_Field_Static('')); | |
parent::_init(); | |
} | |
protected function _beforeSave(Kwf_Model_Row_Interface $row) | |
{ | |
$row->addTo('mail@example.com'); | |
$row->subject = trl('Anfrage auf example.com',$host); | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?=trl('Sie erhielten eine Anfrage auf {0}', $this->host);?>. | |
<?=trl('Nachricht');?>: | |
<?= $this->message; ?> | |
<?=trl('Diese Anfrage wurde gesendet von');?>: | |
<?=trl('Name');?>: <?= $this->name; ?> | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment