DLight\Application\Interfaces\ViewEngine

Mô tả: contract cho các view engine được DLight\Application\View khởi tạo khi bật SUPPORT_VIEW_ENGINE=enable.

Method

  • render(string $template, array $data = []): string

Demo implement tối thiểu

use DLight\Application\Interfaces\ViewEngine;

class MyEngine implements ViewEngine {
  public function __construct(private string $viewPath, private array $options = []) {}
  public function render(string $template, array $data = []): string {
    return "template={$template}";
  }
}