Roots Discourse

Sage 10, Composer controller on ACF block

I’m trying to create a composer controller on a ACF block, this is the code

Title: Latest news
Description: Latest news Block
Category: formatting
Icon: wordpress
Keywords: news
Mode: edit

@php var_dump($test); @endphp


namespace App\View\Composer\Blocks;
use Roots\Acorn\View\Composer\Blocks;
class LatestNews extends Composer
     * List of views served by this composer.
     * @var array
    protected static $views = [ 
    public function with()
        return [ 'test' => 'Hello' ];

but I get an error that $test has not been declared so it seems that it does not enter the LatestNews class.
Do you see something wrong?

acf-composer should make your life easier.

This topic was automatically closed after 42 days. New replies are no longer allowed.