for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace WebServCo\Framework\Traits;
use WebServCo\Framework\Http\Response;
trait OutputTrait
{
protected $outputLoader;
final protected function setOutputLoader(\WebServCo\Framework\AbstractOutputLoader $outputLoader)
$this->outputLoader = $outputLoader;
}
final protected function output()
return $this->outputLoader;
final protected function outputCli($string = '', $eol = true)
return $this->output()->cli($string, $eol);
protected function outputHtmlPartial($data, $template)
return new Response(
$this->output()->html($data, $template),
200,
['Content-Type' => 'text/html']
);
protected function outputHtml($data, $pageTemplate, $mainTemplate = null)
$this->output()->htmlPage($data, $pageTemplate, $mainTemplate),
protected function outputJson($content, $result = true)
$data = [
'result' => $result,
'data' => $content,
];
$this->output()->json($data),
['Content-Type' => 'application/json']