Created
May 31, 2018 13:54
-
-
Save dg/e4b7fe40b78379e289f74c35474d43c2 to your computer and use it in GitHub Desktop.
Transfer of a persistent parameter between two presenters without an inheritance
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 | |
// transfer of a persistent parameter between two presenters without an inheritance | |
// (requires nette/application 3.0.0) | |
trait LangParameter | |
{ | |
/** @persistent */ | |
public $lang; | |
} | |
class OnePresenter extends Nette\Application\UI\Presenter | |
{ | |
use LangParameter; | |
} | |
class TwoPresenter extends Nette\Application\UI\Presenter | |
{ | |
use LangParameter; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment