Skip to content

Instantly share code, notes, and snippets.

@dg dg/after.php
Created May 19, 2014

Embed
What would you like to do?
<?php
class FooControl extends Nette\Application\UIControl
{
public function render()
{
MyTemplate::registerFilters($this->template)
->render(__DIR__ . '/control.latte');
}
}
class BarControl extends Nette\Application\UIControl
{
public function render()
{
MyTemplate::registerFilters($this->template)
->render(__DIR__ . '/control.latte');
}
}
class MyTemplate
{
static function registerFilters($template)
{
$template->addFilter('a', ...);
$template->addFilter('b', ...);
$template->addFilter('c', ...);
return $template;
}
}
<?php
class FooControl extends Nette\Application\UIControl
{
public function render()
{
$template = $this->template;
$template->addFilter('a', ...);
$template->addFilter('b', ...);
$template->addFilter('c', ...);
$template->render(__DIR__ . '/control.latte');
}
}
class BarControl extends Nette\Application\UIControl
{
public function render()
{
$template = $this->template;
$template->addFilter('a', ...);
$template->addFilter('b', ...);
$template->addFilter('c', ...);
$template->render(__DIR__ . '/control.latte');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.