Created
May 19, 2014 15:06
-
-
Save dg/b4a2cbe84c80fb73c553 to your computer and use it in GitHub Desktop.
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 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; | |
} | |
} |
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 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