1

Problem (MRP)

I have a .blade.php-file that references a php-function which should return some html.

{!! $template->render() !!}

The render()-function uses $this and then returns a string.

class Template extends Model {
    function render() : string {
        $this->someEmptyFunc();
        return "Some String";
    }

    function someEmptyFunc() {}
}

someEmptyFunction() doesn't echo anything, and every time that $this gets referenced, this object gets echoed as if I had called echo var_dump($this);

Info

  • The Template class is a Laravel-Model-class
  • The code above is a minimal example that produces the error for me.
  • I dont really want to avoid the bug by exploiting the output-buffer.
xtay2
  • 453
  • 3
  • 14

0 Answers0