arachne/entity-loader

在 nette/application 中启用对象参数。

v0.13.2 2018-08-25 10:05 UTC

README

Build Status Coverage Status Latest stable Downloads this Month License

在 nette/application 中启用对象参数。

// Without EntityLoader
public function actionEdit($id)
{
	$article = $this->em->getRepository(Article::class)->find($id);
	if (! $article) {
		$this->error(); // 404
	}
	// ...
}

// With EntityLoader
public function actionEdit(Article $article)
{
	// ...
}

文档