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

Adding a transient property to my page model for use in my template


Go to End


952 Views

Avatar
doublecheese

Community Member, 5 Posts

21 December 2015 at 3:52pm

HI,

I have a added the following property in my Page object

public $Active

and I'm setting that to true in my controller, however, when I try to evaluate that property in the template it evaluates to true and somehow it seems to be reset to the default value (or perhaps makes my page object immutable).

How do I add a transient property that is not backed by a DB field on my page which I can set in my controller prior to rendering.