Skip to content

Instantly share code, notes, and snippets.

@brabijan
Created July 1, 2013 16:11
Show Gist options
  • Save brabijan/5902235 to your computer and use it in GitHub Desktop.
Save brabijan/5902235 to your computer and use it in GitHub Desktop.
Generovani odkazu mimo presentery
<?php
class DummyPresenter extends \Nette\Application\UI\Presenter
{
protected function startup()
{
parent::startup();
$this->terminate();
}
}
<?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