gmarche/src/Framework/Renderer/RendererInterface.php

34 lines
801 B
PHP

<?php
namespace Framework\Renderer;
interface RendererInterface
{
/**
* Rajoute un chemin pour charger les vues
* @param string $namespace
* @param null|string $path
*/
public function addPath(string $namespace, ?string $path = null): void;
/**
* Rend une vue
* Le chemin peut être précisé avec des namespaces rajoutés via addPath()
* $this->render('@gmarche/view');
* $this->render('view');
* @param string $view
* @param array $params
* @return string
*/
public function render(string $view, array $params = []): string;
/**
* Rajoute des variables globales à toutes les vues
*
* @param string $key
* @param mixed $value
*/
public function addGlobal(string $key, $value): void;
}