DLight\Application\Drive\View\BladeOneDrive

Mô tả: view engine dùng eftec/bladeone. Tạo cache folder nếu bật cache, sau đó render bằng $blade->run().

Public API

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

Cấu hình & demo

// .env
SUPPORT_VIEW_ENGINE=enable
<?php // config/view.php
return [
  'engine' => 'bladeone',
  'view_path' => ROOT_DIR . 'resource/view/',
  'drives' => [
    'bladeone' => [
      'class' => DLight\\Application\\Drive\\View\\BladeOneDrive::class,
      'options' => [
        'cache' => true,
        'cache_path' => INDEX_DIR . 'cache/',
      ],
    ],
  ],
];
use DLight\Application\View;
echo View::render('client.home', ['name' => 'DLight']);