Skip to content

Commit

Permalink
BUGFIX: remove TypoScript and use fusionValue (psmb#14)
Browse files Browse the repository at this point in the history
BUGFIX: remove TypoScript and use fusionValue
  • Loading branch information
mgoldbeck authored and dimaip committed Oct 19, 2018
1 parent e085f18 commit d6c73f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
namespace Psmb\Newsletter\TypoScript;
namespace Psmb\Newsletter\Fusion;

use Neos\Flow\Annotations as Flow;
use Neos\Fusion\FusionObjects\AbstractFusionObject;
use TijsVerkoyen\CssToInlineStyles\CssToInlineStyles;

/**
* A TypoScript Object that inlines styles
* A Fusion Object that inlines styles
*/
class CssToInlineImplementation extends AbstractFusionObject {
/**
Expand All @@ -15,8 +15,8 @@ class CssToInlineImplementation extends AbstractFusionObject {
* @return string
*/
public function evaluate() {
$html = $this->tsValue('value');
$cssFile = $this->tsValue('cssPath');
$html = $this->fusionValue('value');
$cssFile = $this->fusionValue('cssPath');
$css = file_get_contents($cssFile);
$cssToInlineStyles = new CssToInlineStyles();
return $cssToInlineStyles->convert(
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Fusion/Root.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ prototype(Neos.Fusion:GlobalCacheIdentifiers) {
# `cssPath` should contain a path to a CSS file, e.g. `cssPath = 'resource://Psmb.Newsletter/Public/styles.css'`
#
prototype(Psmb.Newsletter:CssToInline) {
@class = 'Psmb\\Newsletter\\TypoScript\\CssToInlineImplementation'
@class = 'Psmb\\Newsletter\\Fusion\\CssToInlineImplementation'
value = ${value}
cssPath = 'to-be-set'
}
Expand Down

0 comments on commit d6c73f6

Please sign in to comment.