Created
July 1, 2013 16:11
-
-
Save brabijan/5902235 to your computer and use it in GitHub Desktop.
Generovani odkazu mimo presentery
This file contains hidden or 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 DummyPresenter extends \Nette\Application\UI\Presenter | |
{ | |
protected function startup() | |
{ | |
parent::startup(); | |
$this->terminate(); | |
} | |
} |
This file contains hidden or 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 SomeClass extends Nette\Object | |
{ | |
/** @var \DummyPresenter */ | |
private $presenter; | |
public function __construct(Nette\Application\IPresenterFactory $presenterFactory) | |
{ | |
/** @var $presenter \DummyPresenter */ | |
$presenter = $presenterFactory->createPresenter("Dummy"); | |
$presenter->autoCanonicalize = FALSE; | |
$presenter->invalidLinkMode = \DummyPresenter::INVALID_LINK_WARNING; | |
$this->presenter = $presenter; | |
$this->presenter->run(new Nette\Application\Request("Dummy", "GET", array())); | |
} | |
public function doSomething() { | |
$this->presenter->link("Foo:bar"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment