Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
61875d97
Commit
61875d97
authored
Oct 23, 2018
by
Christian Giupponi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Possibile fix for alternate variable not set in page
parent
b601dd31
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
BasePublicController.php
Modules/Core/Http/Controllers/BasePublicController.php
+15
-0
PublicController.php
Modules/Page/Http/Controllers/PublicController.php
+4
-4
No files found.
Modules/Core/Http/Controllers/BasePublicController.php
View file @
61875d97
...
...
@@ -13,10 +13,25 @@ abstract class BasePublicController extends Controller
*/
protected
$auth
;
public
$locale
;
public
$alternateUrls
=
[];
public
function
__construct
()
{
$this
->
locale
=
App
::
getLocale
();
$this
->
auth
=
app
(
Authentication
::
class
);
view
()
->
share
(
'alternate'
,
$this
->
alternateUrls
);
}
/**
* Add alternate URLs to main array and inject it to the page
*
* @param array $alternateUrls
* @return void
*/
protected
function
addAlternateUrls
(
array
$alternateUrls
)
{
$this
->
alternateUrls
=
array_merge
(
$this
->
alternateUrls
,
$alternateUrls
);
view
()
->
share
(
'alternate'
,
$this
->
alternateUrls
);
}
}
}
Modules/Page/Http/Controllers/PublicController.php
View file @
61875d97
...
...
@@ -46,9 +46,9 @@ class PublicController extends BasePublicController
$template
=
$this
->
getTemplateForPage
(
$page
);
$
alternate
=
$this
->
getAlternateMetaData
(
$page
);
$
this
->
addAlternateUrls
(
$this
->
getAlternateMetaData
(
$page
)
);
return
view
(
$template
,
compact
(
'page'
,
'alternate'
));
return
view
(
$template
,
compact
(
'page'
));
}
/**
...
...
@@ -62,9 +62,9 @@ class PublicController extends BasePublicController
$template
=
$this
->
getTemplateForPage
(
$page
);
$
alternate
=
$this
->
getAlternateMetaData
(
$page
);
$
this
->
addAlternateUrls
(
$this
->
getAlternateMetaData
(
$page
)
);
return
view
(
$template
,
compact
(
'page'
,
'alternate'
));
return
view
(
$template
,
compact
(
'page'
));
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment