isVisible() public méthode

Check a configuration element visibility
public isVisible ( Magento\Config\Model\Config\Structure\AbstractElement $element, string $scope ) : boolean
$element Magento\Config\Model\Config\Structure\AbstractElement The config composite element
$scope string The element scope
Résultat boolean
Exemple #1
0
 /**
  * Check a configuration element visibility
  *
  * @param \Magento\Config\Model\Config\Structure\AbstractElement $element The config composite element
  * @param string                                                 $scope   The element scope
  *
  * @return bool
  */
 public function isVisible(\Magento\Config\Model\Config\Structure\AbstractElement $element, $scope)
 {
     if (!$element->isAllowed()) {
         return false;
     }
     $isVisible = parent::isVisible($element, $scope);
     if ($isVisible) {
         $isVisible = $element->hasChildren() || $element->getFrontendModel();
     }
     return $isVisible;
 }
Exemple #2
0
 /**
  * Check if the field is visible
  *
  * @return bool
  */
 public function isVisible()
 {
     return $this->visibility->isVisible($this, $this->_scope);
 }