-
-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support shared site.contentType.php
controller
#6950
base: v5/develop
Are you sure you want to change the base?
Support shared site.contentType.php
controller
#6950
Conversation
if ($controller = $this->controllerLookup('site')) { | ||
$data = (array)$controller->call($this, $arguments); | ||
$site = $this->controllerLookup('site', $contentType); | ||
$site ??= $this->controllerLookup('site'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discuss:
Is it ok that we use either or? Or should both site controllers be used, if available?
'template' => 'another' | ||
]); | ||
|
||
ob_start(); | ||
$app->controller('another.json', [], 'json'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question:
Was it ever right to have this test calling with another.json
as name and json
as contentType instead of another
and json
?
@@ -1,3 +1,5 @@ | |||
<?php | |||
|
|||
echo json_encode(['foo' => 'bar']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question:
Why would the controller echo the JSON? Isn't that the job of the template in a content representation?
Description
Summary of changes
site.json.php
site.php
or the more specific representation site controller get merged into any other controller, but never bothReasoning
Allows to globally provide data to all controllers/templates that only a specific content type needs.
Additional context
blog.rss
with noblog.rss.php
controller would take the regularblog.php
controller merged with a potentially existingsite.rss.php
controller. Seems a bit weird, but probably also not harmful. Not sure how I feel about it.Changelog
Enhancement
site.rss.php
Ready?
For review team