nextras/link-factory

This package is abandoned and no longer maintained. No replacement package was suggested.

Simple link factory independent of presenter.

v1.1.0 2015-09-08 12:27 UTC

This package is auto-updated.

Last update: 2020-03-12 16:28:23 UTC


README

====================

This repository is deprecated.
The same functionality is provided by Nette Framework itself.
Use LinkGenerator in nette/application.

====================

Build Status Downloads this Month Stable version HHVM Status

Installation

Add to your composer.json:

"require": {
	"nextras/link-factory": "~1.0"
}

Example

use Nextras\Application\LinkFactory;

class Example
{
	/** @var LinkFactory */
	private $linkFactory;

	public function __construct(LinkFactory $linkFactory)
	{
		$this->linkFactory = $linkFactory;
	}

	public function doSomething()
	{
		// relative link with optional fragment (#comments) and parameters
		$link = $this->linkFactory->link('Products:view#comments', ['id' => 123]);

		// absolute link starts with '//'
		$link = $this->linkFactory->link('//Homepage:default');
	}
}