Tab.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\Backend\Block\Widget;
  8. use Magento\Backend\Block\Widget\Tab\TabInterface;
  9. /**
  10. * @api
  11. * @since 100.0.2
  12. */
  13. class Tab extends \Magento\Backend\Block\Template implements TabInterface
  14. {
  15. /**
  16. * Return Tab label
  17. *
  18. * @return string
  19. */
  20. public function getTabLabel()
  21. {
  22. return $this->getLabel();
  23. }
  24. /**
  25. * Return Tab title
  26. *
  27. * @return string
  28. */
  29. public function getTabTitle()
  30. {
  31. return $this->getTitle();
  32. }
  33. /**
  34. * Can show tab in tabs
  35. *
  36. * @return boolean
  37. */
  38. public function canShowTab()
  39. {
  40. return $this->hasCanShow() ? (bool)$this->getCanShow() : true;
  41. }
  42. /**
  43. * Tab is hidden
  44. *
  45. * @return boolean
  46. */
  47. public function isHidden()
  48. {
  49. return $this->hasIsHidden() ? (bool)$this->getIsHidden() : false;
  50. }
  51. /**
  52. * @return string
  53. */
  54. public function getTabClass()
  55. {
  56. return $this->getClass();
  57. }
  58. /**
  59. * @return string
  60. */
  61. public function getTabUrl()
  62. {
  63. return $this->hasData('url') ? $this->getData('url') : '#';
  64. }
  65. }