for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Faulancer\View\Helper;
use Faulancer\View\AbstractViewHelper;
/**
* Class RenderBlock
*
* @package Faulancer\View\Helper
* @author Florian Knapp <[email protected]>
*/
class RenderBlock extends AbstractViewHelper
{
* Render a defined block from variable
* @param string $block
* @param string $defaultValue
* @return array|string
public function __invoke(string $block, string $defaultValue = '')
if($this->view->getVariable($block) === '') {
return $defaultValue;
}
return trim($this->view->getVariable($block));