Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bobgo-magento-extension
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bob Public Utils
bobgo-magento-extension
Merge requests
!15
Tracking page
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Tracking page
tracking_page
into
dev
Overview
0
Commits
8
Pipelines
0
Changes
9
Merged
Christel Loftus
requested to merge
tracking_page
into
dev
9 months ago
Overview
0
Commits
8
Pipelines
0
Changes
13
Expand
0
0
Merge request reports
Compare
version 2
version 7
436e55f7
9 months ago
version 6
62c32bf0
9 months ago
version 5
abe3e0eb
9 months ago
version 4
d5dc33c1
9 months ago
version 3
0b51db24
9 months ago
version 2
61a9c3d1
9 months ago
version 1
0a4fe2d8
9 months ago
dev (base)
and
version 7
latest version
17cd8bd9
8 commits,
9 months ago
version 7
436e55f7
7 commits,
9 months ago
version 6
62c32bf0
6 commits,
9 months ago
version 5
abe3e0eb
5 commits,
9 months ago
version 4
d5dc33c1
4 commits,
9 months ago
version 3
0b51db24
3 commits,
9 months ago
version 2
61a9c3d1
2 commits,
9 months ago
version 1
0a4fe2d8
1 commit,
9 months ago
Show latest version
13 files
+
383
−
118
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
13
Search (e.g. *.vue) (Ctrl+P)
Block/System/Config/Form/Field/Version.php
0 → 100644
+
66
−
0
Options
<?php
namespace
BobGroup\BobGo\Block\System\Config\Form\Field
;
use
Magento\Framework\Data\Form\Element\AbstractElement
;
use
BobGroup\BobGo\Helper\Data
;
/**
* Displays Version number in System Configuration
*
* This block is responsible for displaying the version number of the BobGo extension
* in the system configuration settings.
*
* @website https://www.bobgo.co.za
*/
class
Version
extends
\Magento\Config\Block\System\Config\Form\Field
{
/**
* @var string
*/
public
const
EXTENSION_URL
=
'https://www.bobgo.co.za'
;
/**
* @var Data
*/
protected
Data
$_helper
;
/**
* Constructor
*
* @param \Magento\Backend\Block\Template\Context $context
* @param Data $helper
*/
public
function
__construct
(
\Magento\Backend\Block\Template\Context
$context
,
Data
$helper
)
{
$this
->
_helper
=
$helper
;
parent
::
__construct
(
$context
);
}
/**
* Get HTML for the element
*
* @param AbstractElement $element
* @return string
*/
protected
function
_getElementHtml
(
AbstractElement
$element
):
string
{
$extensionVersion
=
$this
->
_helper
->
getExtensionVersion
();
$extensionTitle
=
'BobGo'
;
$versionLabel
=
sprintf
(
'<a href="%s" title="%s" target="_blank">%s</a>'
,
self
::
EXTENSION_URL
,
$extensionTitle
,
$extensionVersion
);
// Set the value using setData
$element
->
setData
(
'value'
,
$versionLabel
);
// Ensure the return value is a string or provide a fallback
$value
=
$element
->
getData
(
'value'
);
return
is_string
(
$value
)
?
$value
:
''
;
}
}
Loading