Skip to content

Commit

Permalink
update sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
rez1dent3 committed Dec 22, 2017
1 parent d28be45 commit 00ee5d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 20 deletions.
8 changes: 6 additions & 2 deletions src/FlowNative/FlowNative.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function path(string $view): string
{
return $view;
}

list($bundle, $path) = explode(':', $view, 2);

return $this->folder($bundle, $path);
Expand All @@ -125,8 +125,12 @@ public function sandbox(): Sandbox
*/
public function render($view, array $arguments = [])
{
return $this->sandbox()
\ob_start();

$this->sandbox()
->execute($view, $arguments);

return \trim(\ob_get_clean());
}

}
23 changes: 5 additions & 18 deletions src/FlowNative/Sandbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function content(): Context
*
* @return string
*/
public function execute(string $view, array $arguments): string
public function execute(string $view, array $arguments)
{
/**
* @var Closure $sandbox
Expand All @@ -55,24 +55,13 @@ public function execute(string $view, array $arguments): string
*
* @return string
*/
$sandbox = function (string $__flow__view) {

/**
* @var Context $this
*/
\extract($this->exports(), EXTR_REFS);

// \ob_start();
require $this->native->path($__flow__view);
$sandbox = function (string $__flow__view)
{
include $this->native->path($__flow__view);

return //[
// \trim(\ob_get_clean()),
$this->ext->blocks()->getExtends()// ];
;
return $this->ext->blocks()->getExtends();
};

\ob_start();

$content = clone $this->content;
$_view = $view;
$iterator = 0;
Expand All @@ -94,8 +83,6 @@ public function execute(string $view, array $arguments): string
);
}
while ($_view);

return \trim(\ob_get_clean());
}

}

0 comments on commit 00ee5d0

Please sign in to comment.