Breadcrumb.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace ThurData\Servers\KerioEmail\Core\Models;
  3. use ThurData\Servers\KerioEmail\Core\Helper\BuildUrl;
  4. /**
  5. * Description of Breadcrumb
  6. *
  7. * @autor ThurData <info@thurdata.ch>
  8. */
  9. class Breadcrumb
  10. {
  11. protected $name;
  12. protected $controller;
  13. protected $action;
  14. protected $params = [];
  15. protected $icon;
  16. protected $url;
  17. public function __construct ($name, $controller, $action, $params = [], $icon = null, $isUrl = true)
  18. {
  19. $this->name = $name;
  20. $this->controller = $controller;
  21. $this->action = $action;
  22. $this->params = $params;
  23. $this->icon = $icon;
  24. $this->url = $isUrl ? BuildUrl::getUrl($this->controller, $this->action, $this->params) : null;
  25. }
  26. public function getName()
  27. {
  28. return $this->name;
  29. }
  30. public function isUrl()
  31. {
  32. return ($this->url ? true : false);
  33. }
  34. public function getUrl()
  35. {
  36. return $this->url;
  37. }
  38. public function isIcon()
  39. {
  40. return ($this->icon ? true : false);
  41. }
  42. public function getIcon()
  43. {
  44. return $this->icon;
  45. }
  46. }