Custompath.php 689 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Config backend model for "Custom Admin Path" option
  8. *
  9. * @author Magento Core Team <core@magentocommerce.com>
  10. */
  11. namespace Magento\Config\Model\Config\Backend\Admin;
  12. /**
  13. * @api
  14. * @since 100.0.2
  15. */
  16. class Custompath extends \Magento\Framework\App\Config\Value
  17. {
  18. /**
  19. * Check whether redirect should be set
  20. *
  21. * @return $this
  22. */
  23. public function beforeSave()
  24. {
  25. if ($this->getOldValue() != $this->getValue()) {
  26. $this->_registry->register('custom_admin_path_redirect', true, true);
  27. }
  28. return $this;
  29. }
  30. }