Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gtm
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
gtm
Merge requests
!6
Issue
#3331003
: Drupal Coding Standards Issues | phpcs
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Issue
#3331003
: Drupal Coding Standards Issues | phpcs
issue/gtm-3331003:8.x-1.x
into
8.x-1.x
Overview
0
Commits
1
Pipelines
0
Changes
2
Open
Charchil Khandelwal
requested to merge
issue/gtm-3331003:8.x-1.x
into
8.x-1.x
2 years ago
Overview
0
Commits
1
Pipelines
0
Changes
2
Expand
0
0
Merge request reports
Compare
8.x-1.x
8.x-1.x (HEAD)
and
latest version
latest version
d029fa51
1 commit,
2 years ago
2 files
+
35
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
src/Form/SettingsForm.php
+
34
−
1
Options
@@ -2,14 +2,47 @@
namespace
Drupal\gtm\Form
;
use
Drupal\Core\Config\ConfigFactoryInterface
;
use
Drupal\Core\Form\ConfigFormBase
;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\Core\Language\LanguageManagerInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
/**
* Implements the form controller.
*/
class
SettingsForm
extends
ConfigFormBase
{
/**
* The language manager.
*
* @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected
$languageManager
;
/**
* Constructs a SettingsForm object.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The factory for configuration objects.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
*/
public
function
__construct
(
ConfigFactoryInterface
$config_factory
,
LanguageManagerInterface
$language_manager
)
{
parent
::
__construct
(
$config_factory
);
$this
->
languageManager
=
$language_manager
;
}
/**
* {@inheritdoc}
*/
public
static
function
create
(
ContainerInterface
$container
)
{
return
new
static
(
$container
->
get
(
'config.factory'
),
$container
->
get
(
'language_manager'
),
);
}
/**
* {@inheritdoc}
*/
@@ -70,7 +103,7 @@ class SettingsForm extends ConfigFormBase {
'#description'
=>
$this
->
t
(
"You can add site to
<a target='_blank' href='https://tagmanager.google.com/?hl=@lang'>Google Tag Manager</a>"
,
[
'@lang'
=>
\Drupal
::
languageManager
()
->
getCurrentLanguage
()
->
getId
()]
[
'@lang'
=>
$this
->
languageManager
->
getCurrentLanguage
()
->
getId
()]
),
];
return
parent
::
buildForm
(
$form
,
$form_state
);
Loading