Last active
December 18, 2015 02:19
-
-
Save Majkl578/5710524 to your computer and use it in GitHub Desktop.
Předvyplnění předmětu kontaktního formuláře na základě parametru.
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 ContactPresenter extends Presenter | |
{ | |
public function renderDefault($service = '') | |
{ | |
if ($service === 'taxi') { | |
$this['contactForm']->setDefaults(array('subject' => 'Zájem o Taxi přepravu')); | |
elseif ($service === 'rozvoz') { | |
$this['contactForm']->setDefaults(array('subject' => 'Dotaz k rozvozu')); | |
} | |
} | |
protected function createComponentContactForm() | |
{ | |
// ... | |
} | |
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 | |
$container->router[] = new Route('kontakt[/sluzba-<service>]', 'Front:Contact:default'); |
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
<a n:href="Contact:" class="poptavka">Nepředvyplněný předmět</a> | |
<a n:href="Contact: taxi" class="poptavka">Předvyplněné pro Taxi</a> | |
<a n:href="Contact: rozvoz" class="poptavka">Předvyplněné pro rozvoz</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment