ACC SHELL
<?php
/**
* Homepage presenter.
*
* @author John Doe
* @package MyApplication
*/
class OurTeamPresenter extends BasePresenter
{
public function renderDefault()
{
// dump($this->template->content);
}
public function renderShow($webalizedName)
{
foreach ($this->template->content as $person)
{
if (Nette\Utils\Strings::webalize($person->name->first . " " . $person->name->last) == $webalizedName)
$this->template->person = $person;
}
if (!isset($this->template->person))
throw new \Nette\Application\BadRequestException("Team member $webalizedName not found.");
}
}
ACC SHELL 2018