for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Everlution\AjaxcomBundle\Mutation;
use Everlution\Ajaxcom\Handler;
use Everlution\AjaxcomBundle\AjaxcomException;
use Everlution\AjaxcomBundle\Service\RenderBlock;
/**
* Class ReplaceTitle.
*
* @author Ivan Barlog <[email protected]>
*/
class ReplaceTitle implements MutatorInterface, RenderableInterface
{
use RenderableTrait;
/** @var RenderBlock */
private $renderBlock;
public function __construct(RenderBlock $renderBlock)
$this->renderBlock = $renderBlock;
}
public function mutate(Handler $ajax): Handler
try {
$title = $this->renderBlock->render($this->view, 'title', $this->parameters);
$ajax->container('title')->html($title);
} catch (AjaxcomException $exception) {
// do nothing
} finally {
return $ajax;