Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Disabling Requirements from controller


Go to End


2 Posts   810 Views

Avatar
prezet

Community Member, 6 Posts

30 April 2014 at 10:06pm

From looking at SSViewer it is possible to disable the output of Requirements to the template via the 'includeRequirements(true/false)' method - however I can't work out how to access the instance of SSViewer from my controller to be able to set this option.

I've tried things like this within my action:

$viewer = $this->getViewer($this->getAction());
$viewer->includeRequirements(false);
$viewer->process($this->dataRecord);

and it doesn't seem to make any difference... any help would be appreciated.

Thanks.

Avatar
martimiz

Forum Moderator, 1391 Posts

4 May 2014 at 9:44pm

I'm not sure what you are trying to do, and I've never used this function. So just to make sure: are you aiming at removing one or more requirements that are, for instance, loaded from another module? In that case have a look at clearing and blocking:

http://doc.silverstripe.org/framework/en/reference/requirements