Closed Sc3n3 closed 7 years ago
It looks like the addExtension()
method is not part of the Illuminate\Contracts\View\Factory
interface.
I can understanding adding support for:
$instance->addExtension("blade");
But for your second example, we don't register a "php" compiler, so we'd need to also allow a way of defining additional compilers
Hi @duncan3dc Like assign or with(Illuminate\View\View::with) before render. Or like implements \Yaf\View_Interface
@ccuniverse Sorry I don't understand, you call with()
on the View
, not the factory, eg:
$blade = new \duncan3dc\Laravel\BladeInstance("/var/www/views", "/var/www/cache/views");
$view = $blade->make("github.example");
$view->with("date", "Today");
$html = $view->render();
Do you have some sample code to illustrate the use case for getViewFactory()
?
Please feel free to re-open this pr if you can provide a use case, thanks
Hi, I want to add file extension like these;
$instance = new BladeInstance($views, $cache); $instance->getViewFactory()->addExtension('blade', 'blade'); $instance->getViewFactory()->addExtension('html', 'php');
But, that method is protected, and i cant reach it outside of the class. Could you set it to public or add new public method to reach it?
Thanks.