Files
Woles-Framework/app/Core/Facades/View.php

43 lines
759 B
PHP
Raw Normal View History

<?php
namespace App\Core\Facades;
/**
* NovaCore View Facade
* Static access to view services
*/
class View
{
/**
* Get view instance
*/
public static function instance(): \App\Core\View
{
return app('view');
}
/**
* Render a view
*/
public static function render(string $view, array $data = []): string
{
return self::instance()->render($view, $data);
}
/**
* Check if view exists
*/
public static function exists(string $view): bool
{
return self::instance()->exists($view);
}
/**
* Share data with all views
*/
public static function share(string $key, $value): void
{
self::instance()->share($key, $value);
}
}