Added links between edit page and show page.

This commit is contained in:
Jan Böhmer 2019-03-13 18:41:32 +01:00
parent 63c7beb05b
commit 061ca799e3
6 changed files with 105 additions and 9 deletions

View file

@ -69,6 +69,27 @@ class EntityURLGenerator
throw new EntityNotSupported('The given entity is not supported yet!');
}
public function editURL($entity) : string
{
if($entity instanceof Part)
{
return $this->urlGenerator->generate('part_edit', ['id' => $entity->getID()]);
}
//Otherwise throw an error
throw new EntityNotSupported('The given entity is not supported yet!');
}
public function createURL($entity) : string
{
if($entity instanceof Part)
{
return $this->urlGenerator->generate('part_new');
}
throw new EntityNotSupported('The given entity is not supported yet!');
}
/**
* Generates an HTML link to the info page about the given entity.
* @param $entity mixed The entity for which the info link should be generated.