: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Nextend\Framework\View;
use Nextend\Framework\Pattern\GetPathTrait;
use Nextend\Framework\Pattern\MVCHelperTrait;
use Nextend\Framework\Sanitize;
abstract class AbstractLayout {
* @var AbstractBlock[]|string[]|array[]
protected $contentBlocks = array();
protected $state = array();
* AbstractLayout constructor.
* @param AbstractView $view
public function __construct($view) {
$this->setMVCHelper($view);
$this->getApplicationType()
protected function enqueueAssets() {
$this->getApplicationType()
* @param string $html contains already escaped data
public function addContent($html) {
$this->contentBlocks[] = $html;
* @param AbstractBlock $block contains already escaped data
public function addContentBlock($block) {
$this->contentBlocks[] = $block;
public function displayContent() {
foreach ($this->contentBlocks as $content) {
if (is_string($content)) {
// PHPCS - Content already escaped
echo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} else if (is_array($content)) {
// PHPCS - Content already escaped
echo call_user_func_array($content[0], $content[1]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
public function setState($name, $value) {
$this->state[$name] = $value;
public abstract function render();