Skip to content

Instantly share code, notes, and snippets.

@Majkl578
Last active December 18, 2015 02:19
Show Gist options
  • Save Majkl578/5710524 to your computer and use it in GitHub Desktop.
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.
<?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()
{
// ...
}
<?php
$container->router[] = new Route('kontakt[/sluzba-<service>]', 'Front:Contact:default');
<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