silverstripe / silverstripe-widgets

Widgets subsystem for Silverstripe CMS
http://silverstripe.org
BSD 3-Clause "New" or "Revised" License
38 stars 55 forks source link

control tag is not working #173

Closed nguyenhoanglong1331 closed 6 years ago

nguyenhoanglong1331 commented 6 years ago

I follow the sample from GitHub to create a very simple control. In the Widget file, i have created a function like this :

public function MyTest(){
        $output = new ArrayList();
        $output->push(
            new ArrayData(
                array(
                    'Title' => 'Test'
                )
            )
        );
        return $output;
    }

And on the template file, i put

<% control MyTest %>Test <% end_control %>

but the page throw error

ScopeyNZ commented 6 years ago

Hi, thanks for taking the time to post to our issue tracker.

The issue tracker is reserved for reporting bugs and we don't provide support via the issue tracker. There are great community support options where you can get help including our forum, Stack Overflow (remember to tag as silverstripe) and even Slack.

Sorry we can't be of more help and good luck resolving your problem!

NightJar commented 6 years ago

@nguyenhoanglong1331 unless you're using SilverStripe version 2, you're looking for <% loop $MyTest %> (and <% end_loop %>), not control :)