for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Happyr\BlazeBundle\Twig;
use Happyr\BlazeBundle\Service\BlazeManagerInterface;
use Twig\Extension\RuntimeExtensionInterface;
/**
* @author Tobias Nyholm <[email protected]>
*/
class BlazeRuntime implements RuntimeExtensionInterface
{
* @var BlazeManagerInterface blaze
protected $blaze;
* @param BlazeManagerInterface $blaze
public function __construct(BlazeManagerInterface $blaze)
$this->blaze = $blaze;
}
* Call the blaze service.
*
* @param mixed $object
* @param string $action
* @param bool $absolute
* @return string
public function blaze($object, $action, $absolute = false)
$compObjects = [];
if (is_array($object)) {
$compObjects = $object;
$object = array_shift($compObjects);
if ($absolute) {
return $this->blaze->getUrl($object, $action, $compObjects);
} else {
return $this->blaze->getPath($object, $action, $compObjects);