mirror of
https://github.com/grokability/snipe-it.git
synced 2026-03-12 17:52:00 +08:00
Added nameUrl presenters (for now)
This commit is contained in:
@@ -99,5 +99,14 @@ class ComponentPresenter extends Presenter
|
||||
return json_encode($layout);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate html link to this items name.
|
||||
* @return string
|
||||
*/
|
||||
public function nameUrl()
|
||||
{
|
||||
return (string) link_to_route('consumables.show', e($this->name), $this->id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -119,5 +119,14 @@ class ConsumablePresenter extends Presenter
|
||||
return route('consumables.show', $this->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate html link to this items name.
|
||||
* @return string
|
||||
*/
|
||||
public function nameUrl()
|
||||
{
|
||||
return (string) link_to_route('consumables.show', e($this->name), $this->id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user