mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-22 01:49:05 +02:00
Added links between edit page and show page.
This commit is contained in:
parent
63c7beb05b
commit
061ca799e3
6 changed files with 105 additions and 9 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue