-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from sitegeist/feature/mirrorMockController
FEATURE: Sitegeist.Monocle:MirrorUri endpoint
- Loading branch information
Showing
11 changed files
with
165 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
namespace Sitegeist\Monocle\Controller; | ||
|
||
/** | ||
* This file is part of the Sitegeist.Monocle package | ||
* | ||
* (c) 2016 | ||
* Martin Ficzel <[email protected]> | ||
* Wilhelm Behncke <[email protected]> | ||
* | ||
* This package is Open Source Software. For the full copyright and license | ||
* information, please view the LICENSE file which was distributed with this | ||
* source code. | ||
*/ | ||
|
||
use Neos\Flow\Annotations as Flow; | ||
use Neos\Flow\Mvc\Controller\ActionController; | ||
|
||
/** | ||
* Class MockController | ||
* @package Sitegeist\Monocle\Controller | ||
*/ | ||
class MockController extends ActionController | ||
{ | ||
/** | ||
* Return the given content and the type header | ||
* | ||
* @param string $content | ||
* @param string $type | ||
* @return void | ||
*/ | ||
public function mirrorAction($content = '', $type = 'text/html') | ||
{ | ||
$this->response->setHeader('Content-Type', $type); | ||
return $content; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
prototype(Sitegeist.Monocle:DataUri) { | ||
@class = 'Sitegeist\\Monocle\\FusionObjects\\DataUriImplementation' | ||
@class = 'Sitegeist\\Monocle\\FusionObjects\\DataUriImplementation' | ||
|
||
type = null | ||
content = null | ||
} | ||
type = null | ||
content = null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
prototype(Sitegeist.Monocle:DataUri.Json) < prototype(Neos.Fusion:Component) { | ||
content = null | ||
content = null | ||
|
||
renderer = Sitegeist.Monocle:DataUri { | ||
type = 'application/json' | ||
content = ${Json.stringify(props.content)} | ||
} | ||
} | ||
renderer = Sitegeist.Monocle:DataUri { | ||
type = 'application/json' | ||
content = ${Json.stringify(props.content)} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
prototype(Sitegeist.Monocle:DataUri.Text) < prototype(Neos.Fusion:Component) { | ||
content = null | ||
content = null | ||
|
||
renderer = Sitegeist.Monocle:DataUri { | ||
type = 'text/plain' | ||
content = ${props.content} | ||
} | ||
} | ||
renderer = Sitegeist.Monocle:DataUri { | ||
type = 'text/plain' | ||
content = ${props.content} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
prototype(Sitegeist.Monocle:MirrorUri.Json) < prototype(Neos.Fusion:Component) { | ||
content = null | ||
|
||
renderer = Sitegeist.Monocle:MirrorUri { | ||
type = 'application/json' | ||
content = ${Json.stringify(props.content)} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
Resources/Private/Fusion/Prototypes/MirrorUri/MirrorUri.fusion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
prototype(Sitegeist.Monocle:MirrorUri) < prototype(Neos.Fusion:Component) { | ||
type = null | ||
content = null | ||
|
||
renderer = Neos.Fusion:UriBuilder { | ||
package = 'Sitegeist.Monocle' | ||
controller = 'Mock' | ||
action = 'mirror' | ||
format = 'text' | ||
arguments { | ||
content = ${props.content} | ||
type = ${props.type} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
prototype(Sitegeist.Monocle:MirrorUri.Text) < prototype(Neos.Fusion:Component) { | ||
content = null | ||
|
||
renderer = Sitegeist.Monocle:MirrorUri { | ||
type = 'text/plain' | ||
content = ${props.content} | ||
} | ||
} |