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

Print_r with onAfterWrite


Go to End


2 Posts   743 Views

Avatar
aaroncaldwell

Community Member, 3 Posts

1 January 2015 at 7:37am

Hello All,

I'm trying to print_r and die on a model within onAfterWrite . It doesn't print to the screen in the admin. Any idea of how to accomplish this within the admin? I want to print a few variables to the screen to know what I'm working with.

Any help would be great.

Avatar
martimiz

Forum Moderator, 1391 Posts

2 January 2015 at 9:29am

Just echoing to the screen doesn't go so well with the CMS. You might find your results in the response in FireBug though :)

You could also use a silverstripe logfile (read here:

http://doc.silverstripe.org/framework/en/topics/error-handling#from-silverstripe
http://api.silverstripe.org/3.1/class-SS_Log.html

SS_Log::log("A set of values");