Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
components-3371808
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
components-3371808
Commits
57259caa
Verified
Commit
57259caa
authored
7 years ago
by
Aleksi Peebles
Committed by
Rob Loach
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2837836
by aleksip: Allow modules to define component libraries
parent
27178a9c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Template/Loader/ComponentLibraryLoader.php
+10
-2
10 additions, 2 deletions
src/Template/Loader/ComponentLibraryLoader.php
with
10 additions
and
2 deletions
src/Template/Loader/ComponentLibraryLoader.php
+
10
−
2
View file @
57259caa
...
...
@@ -56,10 +56,18 @@ class ComponentLibraryLoader extends \Twig_Loader_Filesystem {
foreach
(
$extension_type
[
'handler'
]
->
{
$extension_type
[
'method'
]}()
as
$name
=>
$extension
)
{
$existing_namespaces
[]
=
$name
;
// If type is 'module' we need to get the info.
if
(
$type
==
'module'
)
{
$info
=
system_get_info
(
$type
,
$name
);
}
else
{
$info
=
$extension
->
info
;
}
// For each library listed in the .info file's component-libraries
// section, determine the namespace and the path.
if
(
isset
(
$
extension
->
info
[
'component-libraries'
]))
{
foreach
(
$
extension
->
info
[
'component-libraries'
]
as
$namespace
=>
$library
)
{
if
(
isset
(
$info
[
'component-libraries'
]))
{
foreach
(
$info
[
'component-libraries'
]
as
$namespace
=>
$library
)
{
$paths
=
isset
(
$library
[
'paths'
])
?
$library
[
'paths'
]
:
array
();
// Allow paths to be an array or a string.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment