Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Error using the BladeRenderer.php class #14

Open
codealfa opened this issue Nov 10, 2021 · 0 comments
Open

Fatal Error using the BladeRenderer.php class #14

codealfa opened this issue Nov 10, 2021 · 0 comments

Comments

@codealfa
Copy link

codealfa commented Nov 10, 2021

Steps to reproduce the issue

If you use the BladeRenderer without injecting a factory then you get error:

Fatal error: Uncaught ArgumentCountError: Too few arguments to function Illuminate\View\Compilers\Compiler::__construct()

Seems BladeCompiler extends Compiler that requires both $filesystem and a $cachePath as parameters.

Sample code:

use Joomla\Renderer\BladeRenderer;
use Joomla\View\HtmlView;

$renderer = new BladeRenderer();
$renderer->addFolder(dirname(__FILE__, 2 ) . '/View');

$view = new HtmlView($renderer);
$view->setLayout('main');

echo $view->render();

Expected result

The Factory dependency for BladeRenderer is not required so should be able to work with default parameters.

Actual result

Throws Fatal Error when used with default parameters.

System information (as much as possible)

Linux ubuntu-desktop 5.4.0-89-generi
PHP 8.0.12

Additional comments

To use this renderer one must inject a factory properly configured with a cache path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant