Skip to content

Fatal Error using the BladeRenderer.php class #14

@codealfa

Description

@codealfa

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions