mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-05 23:15:50 +01:00
Added links between edit page and show page.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user