Skip to content

Commit

Permalink
Refactor template declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
jissereitsma committed Feb 27, 2024
1 parent a25ac5a commit aefc601
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 39 deletions.
13 changes: 1 addition & 12 deletions Block/Adminhtml/System/Config/Gd.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,7 @@

class Gd extends Field
{
/**
* Override to set a different PHTML template
*
* @return $this
*/
protected function _prepareLayout()
{
parent::_prepareLayout();
$this->setTemplate('config/gd.phtml');

return $this;
}
protected $_template = 'config/gd.phtml';

/**
* Override to render the template instead of the regular output
Expand Down
19 changes: 4 additions & 15 deletions Block/Adminhtml/System/Config/ModuleVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

class ModuleVersion extends Field
{
protected $_template = 'config/module_version.phtml';

/**
* @var ComponentRegistrar
*/
Expand Down Expand Up @@ -74,19 +76,6 @@ public function __construct(
$this->moduleName = $moduleName;
}

/**
* Override to set a different PHTML template
*
* @return $this
*/
protected function _prepareLayout()
{
parent::_prepareLayout();
$this->setTemplate('config/module_version.phtml');

return $this;
}

/**
* Override to render the template instead of the regular output
*
Expand Down Expand Up @@ -150,14 +139,14 @@ private function getModuleVersionFromModuleXml(): string

return '';
}

public function hasHyvaYireoNextGenImages(): bool
{
$module = $this->moduleList->getOne('Hyva_YireoNextGenImages');
if (!empty($module)) {
return true;
}

return false;
}
}
13 changes: 1 addition & 12 deletions Block/Adminhtml/System/Config/PhpVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,7 @@

class PhpVersion extends Field
{
/**
* Override to set a different PHTML template
*
* @return $this
*/
protected function _prepareLayout()
{
parent::_prepareLayout();
$this->setTemplate('config/php_version.phtml');

return $this;
}
protected $_template = 'config/php_version.phtml';

/**
* Override to render the template instead of the regular output
Expand Down

0 comments on commit aefc601

Please sign in to comment.